Re: Variables in 4gl
Posted in 1991
Forwarded from: infmx!washington!scottm@uunet.UU.NET -- Walt Hultgren Internet: walt@rmy.emory.edu Emory University, Atlanta, GA, USA BITNET: walt@EMORY Voice: +1 404 727 0648 UUCP: {...,rutgers,gatech}!emory!rmy!walt --- Header ------------------------------------------------------------------- > From infmx!washington!scottm@uunet.UU.NET Thu Mar 28 17:49:41 1991 > Received: from emory.mathcs.emory.edu by > rmy.rmy.emory.edu (5.59/2.14.EUCC-MathCS) via SMTP > id AA17044 ; Thu, 28 Mar 91 17:49:40 EST > Received: from relay1.UU.NET by > emory.mathcs.emory.edu (5.59/2.20.EUCC-MathCS) via SMTP > id AA00949 ; Thu, 28 Mar 91 17:50:08 EST > Return-Path: infmx!washington!scottm@uunet.UU.NET > Received: from infmx.UUCP by relay1.UU.NET with UUCP > (5.61/UUNET-shadow-mx) id AA22879; Thu, 28 Mar 91 17:50:18 -0500 > Received: from washington. by informix.com (4.1/SMI-4.1) > id AA14287; Thu, 28 Mar 91 13:38:37 PST > Received: by washington. (4.0/SMI-4.0) > id AA28087; Thu, 28 Mar 91 16:39:11 EST > Date: Thu, 28 Mar 91 16:39:11 EST > From: infmx!washington!scottm@uunet.UU.NET (A. Scott Myers SSE) > Message-Id: <9103282139.AA28087@washington.> > To: informix-news-gate@rmy.emory.edu, uunet!mathcs.emory.edu!walt@uunet.UU.NET > Subject: Re: Variables in 4gl --- Message ------------------------------------------------------------------ Hopefully this code is what you are after. scottm ------------------------------------------------------------ DATABASE cee MAIN DEFINE p_sap RECORD LIKE sap.* define cquery char(300) define inpa char(3) let cquery="SELECT npa,nnx,inhour,outhour,misci FROM sap WHERE npa=? ORDER BY npa,nnx" prepare pcquery from cquery declare dcquery cursor for pcquery START REPORT sap_list prompt "Enter the npa value: " for inpa open dcquery using inpa while true fetch dcquery into p_sap.npa, p_sap.nnx, p_sap.inhour, p_sap.outhour, p_sap.misci if status = NOTFOUND then exit while end if OUTPUT TO REPORT sap_list (p_sap.npa, p_sap.nnx, p_sap.inhour, p_sap.outhour, p_sap.misci) end while close dcquery FINISH REPORT sap_list END MAIN REPORT sap_list (npa, nnx, inhour, outhour, misci) DEFINE npa char(3), nnx char(3), inhour char(12), outhour char(120), misci char(50) OUTPUT report to pipe "pg" LEFT MARGIN 0 FORMAT PAGE HEADER print "NPA/NNX",column 12, "IN HOURS", column 24,"OUT OF HOURS",column 45,"MISCELLANEOUS INFORMATION" print "================================================================================" ON EVERY ROW print npa,"-",nnx, column 10,outhour clipped, 2 spaces, inhour clipped,2spaces,misci page trailer skip 1 line print column 30,pageno using "Page ##" END REPORT --- End of Message -----------------------------------------------------------