Just in case, this is the whole source:

%define {
Libnam = "PVIDAL"
Filnam = "SD273184F"
Fldnam =
"IJACNS,IJPDSC,IJPTYP,PPLANNER,IJACNT,IJACNU,IJCDSC,IJCTYP,CPLANNER,IJADUQ,IJACN4"
Hdgnam = "Parent Item,Parent Desc,Parent I/T,Parent Planner,UsrSeq,Comp
Item,Comp Desc,Compt I/T,Compt Planner,BOM Level,Qty Per"
ALIST = ""
CLIST = ""
HLIST = ""
whereClause = ""
%}

%function(dtw_sql) getattr() {
select SCALE, SYS_CNAME from QSYS2/SYSCOLUMNS
where SYS_DNAME = '$(Libnam)' and SYS_TNAME ='$(Filnam)'
%report {
%row {
%if (V1 >= "0") @dtw_assign(align,"right")
%else @dtw_assign(align,"left") %endif
%if (ROW_NUM=="1") @dtw_assign(SLIST,align)
@dtw_assign(FLIST,V2)
%else @dtw_concat(SLIST," $(align)",SLIST)
@dtw_concat(FLIST," $(V2)" ,FLIST)
%endif
%}
%if (Fldnam=="") @dtw_assign(Fldnam,"*") %endif
%if (Fldnam=="*") @dtw_assign(CLIST,FLIST)
%else @dtw_replace(Fldnam,","," ",CLIST) %endif
@dtw_assign(i,"0") @dtw_words(CLIST,)
%while (i < max) { @dtw_add(i,"1",i)
@dtw_word(CLIST,i,colnam)
@dtw_wordpos(colnam,FLIST,n)
@dtw_word(SLIST,n,align)
@dtw_concat(ALIST," $(align)",ALIST)
%}
%if (Hdgnam == "") @dtw_assign(HLIST,CLIST)
%else @dtw_replace(Hdgnam," ","~",HLIST)
@dtw_replace(HLIST ,","," ",HLIST) %endif
%}
%}

%macro_function setfilter() {
@dtw_assign(sep,"WHERE ")
@dtw_assign(i,"0") @dtw_words(CLIST,max)
%while (i < max) { @dtw_add(i,"1",i)
%if (@dtw_rword(ALIST,i)=="right") @dtw_assign(quote,"")
%else @dtw_assign(quote,"'") %endif
@dtw_word(CLIST,i,colnam)
@dtw_assign(value,"$($(colnam))")
%if (value != "")
@dtw_assign(whereClause,"$(whereClause)$(sep)$(colnam) =
$(quote)$(value)$(quote)")
@dtw_assign(sep," AND ")
%endif
%}
%}

%function(dtw_sql) list() {
SELECT $(Fldnam) FROM $(Libnam)/$(Filnam)
$(whereClause)
%report {<table border style="border-collapse:collapse">
@dtw_words(CLIST,max)
<tr> @dtw_assign(i,"0")
%while (i < max) { @dtw_add(i,"1",i)
@dtw_replace(@dtw_rword(HLIST,i),"~"," ",name)
<th bgcolor="gray">$(name)</th>
%} </tr>
<tr> @dtw_assign(i,"0")
%while (i < max) { @dtw_add(i,"1",i)
@dtw_word(CLIST,i,name) @dtw_assign(value,"$($
(name))")
<td><input name="$(name)" value="$(value)"></td>
%} </tr>
%row { <tr> @dtw_assign(i,"0")
%while (i < max) { @dtw_add(i,"1",i)
@dtw_assign(value,"$(V$(i))")
<td align="@dtw_rword(ALIST,i)">$(value)</td>
%} </tr>
%}
</table>
%}
%message { 100 : "<p><b>No records selected</b>" : continue %}
%}
%html(macro) {
@getattr()
@setfilter()
<form method="POST">
@list()
<p><input type="submit" value="Submit">
</form>
%}


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

" Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)


--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.