🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pb.informix
Article #1

Variables in 4gl

#1
From: Mike Payer
Date: Wed, 27 Mar 1991 18:03
77 lines
3176 bytes
I am looking for a little bit of help with the small 4gl report below.
This report as written works very well an did exactly what we wanted
it to so at the time. OK so now the problem is that our database has
gotten so large that we want to be able to limit the output by npa. What I
am asking is how do you go about get a prompt in this report that will set
a variable for npa..

Any help would be appreciated.

Thank You.
==========================================================================
DATABASE cee

MAIN

        DEFINE p_sap RECORD LIKE sap.*

        DECLARE q_curs CURSOR FOR
                SELECT npa,nnx,inhour,outhour,misci
                FROM sap
                WHERE npa = SOMETHING
                ORDER BY npa,nnx

        START REPORT sap_list

        FOREACH q_curs INTO p_sap.npa,
                            p_sap.nnx,
                            p_sap.inhour,
                            p_sap.outhour,
                            p_sap.misci


        OUTPUT TO REPORT sap_list (p_sap.npa,
                                   p_sap.nnx,
                                   p_sap.inhour,
                                   p_sap.outhour,
                                   p_sap.misci)

        END FOREACH
        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
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


      ____________________________________________________________
     /\                  Michael S Payer Jr                       \
     \_|     Administrator              FAX 415-867-0344          |
       |     Emergency Control Center   pacbell!pbecc!msp         |
       |                   pacbell!pbhya!mspayer                  |
       |                                                          |
       |   ____________SOMETIMES THE DRAGON WINS__________________|__
        \_/_________________________________________________________/
Technical Details
Message-ID: <13799@pbhya.PacBell.COM>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!decwrl!pacbell.com!pacbell!pbhya!mspayer

Show Full Headers
Complete Article Headers
Message-ID: <13799@pbhya.PacBell.COM>
Subject: Variables in 4gl
Date: Wed, 27 Mar 1991 18:03:34 +0000
From: mspayer@PacBell.COM (Mike Payer)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!decwrl!pacbell.com!pacbell!pbhya!mspayer
Newsgroups: comp.databases,pb.informix
Reply-To: mspayer@PacBell.COM (Mike Payer)
Followup-To: comp.databases
Distribution: ca
Organization: Pacific * Bell, San Ramon, CA
Lines: 76