|
Jake, Just a few comments.First, the EXTPGM( ) keyword isn't needed here. I'm guessing that WMSPRNT_06 is the name of the program which called this program, and that it is the one that has the display file. The prototype here (PR/PI) defines the *Entry PLIST (incoming parms). Use the EXTPGM( ) when you want to define a call by prototype to another program (no PI used in that case).
Second, I couldn't find where the value of "wrhouse" was set. I'm getting old and the eyesight is going, but a search only found it in the data structure and output. That, of course, won't cause the program to fail; just output blanks in the output.
* Jerry C. Adams
*IBM System i Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
615.995.7024
fax
615.995.1201
email
jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>
Jake M wrote:
Hello Pro's,
I have coded an SQLRPGLE program which takes a parameter and creates a
report. I want this parameter to be supplied using a Display File. Is this
possible? I am still learning RPG so this might be an extremely easy
question so please be gentle. Here is my program.
=============================================================================================
H ActGrp(*CALLER)
H DftActGrp(*NO)
Fqsysprt o f 132 printer
D whchoice PR EXTPGM('WMSPRNT_06')
D warehouse 2
D whchoice PI
D warehouse 2
d myDS ds
D wrhouse 2a
D icwmsn 6a
D icwmbl 14a
D icwmbt 5a
D icwmas 5a
D icwmdb 1a
D icwmal 1a
D icwmps 9s 0
D icwmbs 1a
C/EXEC SQL
C+ Set Option
C+ Naming = *Sys,
C+ Commit = *None,
C+ UsrPrf = *User,
C+ DynUsrPrf = *User,
C+ Datfmt = *iso,
C+ CloSqlCsr = *EndMod,
C+ Commit = *NONE
C/END-EXEC
C/exec sql
C+ declare mainCursor Cursor
C+ for
C+ select icwmwh, icwmsn, icwmbl, icwmbt,
C+ icwmas, icwmdb, icwmal, icwmps, icwmbs
C+ from mylib/icwmap where icwmwh =:warehouse
C/end-exec
C/exec sql
C+ open mainCursor
C/end-exec
C/exec sql
C+ fetch next
C+ from mainCursor
C+ into :myDS
C/end-exec
/FREE
except heading;
dow SQLSTT = '00000';
except detail;
/END-FREE
C/exec sql
C+ fetch next
C+ from mainCursor
C+ into :myDS
C/end-exec
/FREE
enddo;
*inlr = *on;
/END-FREE
Oqsysprt e heading 1
O + 1 'WH'
O + 1 'SEC'
O + 3 'BIN'
O + 1 'TYP'
O + 1 'AVAIL'
O + 1 'DEDBIN'
O + 10 'AVAL4LETDOWN'
O + 12 'SEQ'
O + 18 'STATUS'
Oqsysprt e detail 3
O wrhouse + 1
O icwmsn + 1
O icwmbl + 1
O icwmbt + 1
O icwmas + 1
O icwmdb + 1
O icwmal + 1
O icwmps + 12
O icwmbs + 12
=================================================================================================
Thanks in advance,
Jake.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.