|
Ok, here's what I have so far: CL Program to get Total Records in spool file (format SPLA0100). Following it is a program that calls it, ALWAYS returning &SPL0 as 1077952576. PGM PARM(&JNAME &JID &SPLFID &SPLFNM &SPLFNUM + &SPLBIN &SPL0) /* INCOMING */ DCL VAR(&JNAME) TYPE(*CHAR) LEN(26) DCL VAR(&JID) TYPE(*CHAR) LEN(16) DCL VAR(&SPLFID) TYPE(*CHAR) LEN(16) DCL VAR(&SPLFNM) TYPE(*CHAR) LEN(10) DCL VAR(&SPLFNUM) TYPE(*CHAR) LEN(4) /* INCOMING */ DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(1520) DCL VAR(&RCVLEN) TYPE(*CHAR) LEN(4) + VALUE(X'000005F0') DCL VAR(&FMTNAM) TYPE(*CHAR) LEN(8) DCL VAR(&RESET) TYPE(*CHAR) LEN(10) DCL VAR(&ERR) TYPE(*CHAR) LEN(10) /* OUTGOING */ DCL VAR(&SPL0) TYPE(*DEC) LEN(12 0) DCL VAR(&SPLBIN) TYPE(*CHAR) LEN(4) /* OUTGOING */ DCL VAR(&SPL) TYPE(*DEC) LEN(6 4) VALUE(0) DCL VAR(&SPLCHAR) TYPE(*CHAR) LEN(7) CHGVAR VAR(&FMTNAM) VALUE('SPLA0100') CHGVAR VAR(&RESET) VALUE('*NO') CALL PGM(QUSRSPLA) PARM(&RCVVAR &RCVLEN &FMTNAM + &RESET &ERR) CHGVAR VAR(&SPLBIN) VALUE(%SST(&RCVVAR 721 4)) CHGVAR VAR(&SPL0) VALUE(%BIN(&SPLBIN)) ENDPGM Here's a program that calls it. &SPL0 ALWAYS returns 1077952576 PGM DCL VAR(&DATFMT) TYPE(*CHAR) LEN(4) DCL VAR(&DATSEP) TYPE(*CHAR) LEN(1) /* OUTGOING */ DCL VAR(&JNAME) TYPE(*CHAR) LEN(26) DCL VAR(&JID) TYPE(*CHAR) LEN(16) DCL VAR(&SPLFID) TYPE(*CHAR) LEN(16) DCL VAR(&SPLFNM) TYPE(*CHAR) LEN(10) DCL VAR(&SPLFNUM) TYPE(*CHAR) LEN(4) /* OUTGOING */ /* INCOMING */ DCL VAR(&SPL0) TYPE(*DEC) LEN(12 0) DCL VAR(&SPLBIN) TYPE(*CHAR) LEN(4) /* INCOMING */ CLRPFM FILE(OPERATIONS/PREPOQRY) RUNQRY QRY(GALS/PREPOM1C) OUTTYPE(*PRINTER) + OUTFORM(*DETAIL) PRTDFN(*NO) + PRTDEV(*PRINT) FORMSIZE(200 200) + OUTFILE(*RUNOPT *FIRST *RPLFILE) RTVJOBA JOB(&JNAME) NBR(&JID) CHGVAR VAR(&SPLFNM) VALUE('QPQUPRFIL') CHGVAR VAR(&SPLFNUM) VALUE('0000FFFF') CALL PGM(OPERATIONS/GETSPLFATT) PARM(&JNAME &JID + &SPLFID &SPLFNM &SPLFNUM &SPLBIN &SPL0) CPYSPLF FILE(QPQUPRFIL) TOFILE(OPERATIONS/IIQ90QRY) + SPLNBR(*LAST) DLTSPLF FILE(QPQUPRFIL) SPLNBR(*LAST) CPYTOPCD FROMFILE(OPERATIONS/IIQ90QRY) TOFLR(OPER) + TODOC(GP.TXT) REPLACE(*YES) SNDDST TYPE(*DOC) + TOINTNET(('m1c@xxxxxxxxxxxxxxxxx')) + DSTD('Gross Profit Query') MSG('Orders + with Gross Profit < 20%') DOCFILE(*NONE) + DOC(GP.TXT) FLR(OPER) ENDPGM -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement Sent: Thursday, August 11, 2005 11:55 AM To: Midrange Systems Technical Discussion Subject: Re: QUSRSPLA Hi Richard, > The only reason i don't use this technique, is that you are not always > sure that a spol was produced by the pgm. and in this case, if you mail > the last one (for example) it is not necessary the one you are > expecting. I guess if the user uses the attention key or system request key to interrupt your program and run another one that generates a spooled file, you could end up mailing the wrong one, though I think that's an unusual circumstance. Especially if you specify the spooled file name. However, I do agree that if you know the spooled file number, it's better to use it. When you don't, you use something like *LAST (which is -1 for the QUSRSPLA API).
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.