
Can you clarify the question? That is, does every such printer have a device description (*DEVD) with an IP address configured in it?
Printers can have output routed to them over TCP/IP without having an IP address in the printer device description. There are multiple possible configuration alternatives. It might require multiple solutions. Any number of printer device descriptions might have IP addresses only when they are active, e.g., virtual printers.
Tom

An IP scanner could be an option. Have you considered it ?

Hi Thanks for the answers so far, they are all remote writers. Some have names but most resolve by IP address. Not sure if this helps?

There must be a way to tell if the device on a specific ip address is a printer or not. It could be based on the name (DNS) or it could be by means of some type of query mechanism, such as SNMP.
If an IP scanner is not enough, maybe you could use an SNMP monitoring application (such as Zenoss, Zabbix, Spiceworks, etc). This kind of tools can usually identify the type of device (among other things) by executing SNMP queries (provided the devices supports it).

…so far, they are all remote writers.
Remote writers commonly are started with the STRRMTWTR command to handle ‘remote *OUTQs’. So, are you looking to get the attributes from those ‘remote *OUTQs’?
Or are you wanting to do more like what Carlosdl is thinking — essentially scan your network to locate devices that serve printing?
This comment needs clarification:
…to go into the set up of each individual printer.
Does that refer to printer *DEVDs on the AS/400 or does it refer to visiting physical printers to see what IP address has been configured in them?
If we’re talking about ‘remote writers’, then any printer *DEVDs won’t need IP addresses. But *OUTQs that the writers access will have IP addresses. A remote writer doesn’t necessarily communicate with a “printer”; it usually communicates with some type of “print server”.
This might be seeming complicated already, but it’s a part of what happens when a lot of options are available and heterogeneous networks have all kinds of devices in them.
Your problem can be addressed. It just needs to include all the parts that you really need.
Tom

I have recieved an answer for this in the format of 5 sets of code that give me what I need. I have 5 text files with source in I’d like to share with the team. Is there a way I can attach them here?


For some reason, my first post did not show up so, here it is again.
The code listed below runs every Friday and returns the IP address of the outq’s on our i5.
File OUTQIP is an outfile of the outq’s on the system. File RTNOUTQIPF is where the program writes the outq name, library and IP address.
The code originally came from http://www.think400.dk/apier_3.htm#eks0014. I just modified it to return the IP address.
HOPTION(*NODEBUGIO:*SRCSTMT) ********************************************************************** * PROGRAM NAME: RTNQUTQIPR * * CREATION DATE: 11/09/05 * * PURPOSE OF PROGRAM: CREATE A FILE OF OUTQ’S AND THEIR IP ADDRESS * * * * * * THIS PROGRAM WAS TAKEN FROM QSPROUTQ WHICH WAS TAKEN FROM * * http://www.think400.dk/apier_3.htm#eks0014 * * * ********************************************************************** * FILES USED BY PROGRAM * ********************************************************************** FRTNOUTQIPFIF A E K DISK FOUTQIP IF E K DISK **– API error data structure: —————————————–** D ApiError Ds D AeBytPrv 10i 0 Inz( %Size( ApiError )) D AeBytAvl 10i 0 D AeExcpId 7a D 1a D AeExcpDta 128a **– Output queue information structure: ——————————-** D OUTQ0200 Ds D O2BytRtn 10i 0 D O2BytAvl 10i 0 D O2OutQnam 10a D O2OutQlib 10a D O2FilOrd 10a D O2DspAnyF 10a D O2JobSep 10i 0 D O2OprCtl 10a D O2DtaQnam 10a D O2DtaQlib 10a D O2AutChk 10a D O2NbrF 10i 0 D O2OutQsts 10a D O2OutQtxt 50a D O2NbrSplFpag 10i 0 D O2NbrWtrStr 10i 0 D O2AutWtrStr 10i 0 D O2RmtSysNamTp 1a D O2RmtSysNam 255a D O2RmtPrtQ 128a D O2MsgQnam 10a D O2MsgQlib 10a D O2ConTyp 10i 0 D O2DesTyp 10i 0 D O2VmMvsCls 1a D O2FrmCtlBuf 8a D O2HstPrtTfr 1a D O2MnfTypMod 17a D O2WscObjNam 10a D O2WscObjLib 10a D O2SplFaspA 1a D O2OfsMxSpfPge 10i 0 D O2NbrPgeRtn 10i 0 D O2LenPgeRtn 10i 0 D O2OfsWtrE 10i 0 D O2NbrWtrRtn 10i 0 D O2LenWtrRtn 10i 0 D O2DesOpt 128a D O2WtrTypStr 1a D O2PrtSepPag 1a D O2RmtPrtQLong 255a D 3a D O2OthFlds 120a D O2Data 1024a ** D PxOutqNam s 20a D OUTQLIB S 10A **– Retrieve output queue information: ——————————–** D RtvOutqInf Pr ExtPgm( ‘QSPROUTQ’ ) D RqRcvVar 32767a Options( *VarSize ) D RqRcvVarLen 10i 0 Const D RqFmtNam 8a Const D RqOutQ 20a Const D RqError 32767a Options( *VarSize ) ** **– mainline: ———————————————————** ** ** C DOW NOT %EOF C READ OUTQIP C EVAL PxOutqNam = ODOBNM + ODLBNM ** C CallP RtvOutqInf( OUTQ0200 C : %Size( OUTQ0200 ) C : ‘OUTQ0200′ C : PxOutqNam C : ApiError C ) ** C If AeBytAvl = *Zero ** C If O2ConTyp = 2 C EVAL RTNOUTQ = ODOBNM C EVAL RTNLIB = ODLBNM C EVAL RTNIPADR = %TRIM(O2RmtSysNam) C WRITE RTNOUTQIP C CLEAR RTNOUTQIP C EndIf C EndIf C ENDDO ** C Return

Is there a way I can attach them here?
So far, the only way to “attach” is to cut/paste text. Ideally, the pasted text would be between the {code} and {/code} tags provide by the buttons above a Discussion entry box.
For complex items, try using http://pastebin.com/ to paste into. It’s a reliable code sharing/collaboration site that returns a link to you. Once you store something at pastebin, you can put the link back here.
There might be other similar sites that others can recommend.
Tom

Code 1 of 5
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTR 12/01/12 14:53:54 Page 1
From file . . . . . : WRKRMTWTR/WRKRMTWTRS Member . . : WRKRMTWTR Record format . . . . . : @COPY
Record length . . . : 112
To file . . . . . . : *PRINT
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
100 /* http://home.columbus.rr.com/jbmmdietz */ 2/09/08
200 /* This is a complete rewrite from my first version. */ 2/09/08
300 /* I am using a page-at-a-time subfile which removes the restriction */ 2/09/08
400 /* of 9,999 outqs(subfile records) which a few people have run into. */ 2/09/08
500 /* Enjoy this software, it was fun to write. If you want to improve it */ 2/09/08
600 /* send me an email at the address below with your changes. */ 2/09/08
700 /* If you just have a “I wish it could do this” send that along too. */ 2/09/08
800 /* Please remember that I wrote this as an exersise, and it did not cost you very much. */ 2/09/08
900 /* Thanks to all whose code snippets I used. */ 2/09/08
1000 2/09/08
1100 /* COPYRIGHT 2008 Bryan Dietz bryandietz@yahoo.com */ 2/09/08
1200 2/09/08
1300 CMD PROMPT(’Work with Remote Writers’) 30/07/08
1400 PARM KWD(OUTQ) TYPE(QUAL) PROMPT(’Outq’ 1) 30/07/08
1500 PARM KWD(SORTBY) TYPE(*CHAR) LEN(1) RSTD(*YES) + 30/07/08
1600 DFT(L) VALUES(L O) PROMPT(’Sort by (O)utQ + 30/07/08
1700 (L)ibrary’ 2) 30/07/08
1800 PARM KWD(OUTPUT) TYPE(*CHAR) LEN(4) RSTD(*YES) + 30/07/08
1900 DFT(*) VALUES(DISP FILE) SPCVAL((* DISP) + 30/07/08
2000 (*FILE FILE)) CHOICE(’*, *FILE’) + 30/07/08
2100 PROMPT(’Output’ 3) 30/07/08
2200 PARM KWD(FILE) TYPE(FILE) PMTCTL(ISFILE) + 30/07/08
2300 PROMPT(’File Name’ 4) 30/07/08
2400 30/07/08
2500 PARM KWD(FILEOPT) TYPE(*CHAR) LEN(3) RSTD(*YES) + 30/07/08
2600 DFT(*ADD) SPCVAL((*ADD ‘ADD’) (*REPLACE + 30/07/08
2700 ‘RPL’)) EXPR(*YES) PROMPT(’File Option’ 5) PMTCTL(ISFILE) 5/08/08
2800 30/07/08
2900 QUAL: QUAL TYPE(*GENERIC) DFT(*ALL) SPCVAL((*ALL)) 30/07/08
3000 QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) SPCVAL((*ALL) + 30/07/08
3100 (*LIBL) (*CURLIB) (*USRLIBL) (*ALLUSR)) + 30/07/08
3200 PROMPT(’Library’) 30/07/08
3300 FILE: QUAL TYPE(*NAME) LEN(10) 30/07/08
3400 QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + 30/07/08
3500 SPCVAL((*LIBL)) PROMPT(’Library’) 30/07/08
3600 ISFILE: PMTCTL CTL(OUTPUT) COND((*EQ ‘FILE’)) 30/07/08
36 records copied to member or label *N in file QSYSPRT in library QSYS. 0 records excluded.
* * * * * E N D O F C O M P U T E R P R I N T O U T * * * * *

Code 2/5
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRD 12/01/12 14:53:22 Page 1
From file . . . . . : WRKRMTWTR/WRKRMTWTRS Member . . : WRKRMTWTRD Record format . . . . . : @COPY
Record length . . . : 112
To file . . . . . . : *PRINT
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
100 A*%%TS SD 20081030 093938 DUBSYSBD01 REL-V5R3M0 5722-WDS 30/10/08
200 A* http://home.columbus.rr.com/jbmmdietz 2/09/08
300 A* This is a complete rewrite from my first version. 2/09/08
400 A* I am using a page-at-a-time subfile which removes the restriction 2/09/08
500 A* of 9,999 outqs(subfile records) which a few people have run into. 2/09/08
600 A* Enjoy this software, it was fun to write. If you want to improve it 2/09/08
700 A* send me an email at the address below with your changes. 2/09/08
800 A* If you just have a “I wish it could do this” send that along too. 2/09/08
900 A* Please remember that I wrote this as an exersise, and it did not cost y 2/09/08
1000 A* Thanks to all whose code snippets I used. 2/09/08
1100 A*%%EC 30/10/08
1200 A DSPSIZ(24 80 *DS3) 30/10/08
1300 A CA03(03) 30/10/08
1400 A CA12(03) 30/10/08
1500 A CF05 30/10/08
1600 A CF06 30/10/08
1700 A CF09 30/10/08
1800 A CF10 30/10/08
1900 A* 18/07/08
2000 A R SFLRCD SFL 25/07/08
2100 A* 18/07/08
2200 A N25 OPT 1A B 7 2VALUES(’D’ ‘P’ ‘1′ ‘2′ ‘3′ ‘4′ ‘5′ - 25/07/08
2300 A ‘6′ ‘8′ ‘ ‘) 25/07/08
2400 A OBJNAME 10A O 7 4 25/07/08
2500 A 25 COLOR(RED) 25/07/08
2600 A OBJSLIB 10A O 7 15 25/07/08
2700 A 25 COLOR(RED) 25/07/08
2800 A NBRSPLF 6Y 0O 7 26EDTCDE(3) 25/07/08
2900 A OQSTS 4A O 7 33 25/07/08
3000 A OQIP 15A O 7 38 25/07/08
3100 A 25 COLOR(RED) 25/07/08
3200 A RMTQ 10A O 7 54 25/07/08
3300 A WSCST 10A O 7 65 25/07/08
3400 A WSTS 4A O 7 76 25/07/08
3500 A BMDSAV 7S 0H 25/07/08
3600 A* 6/06/08
3700 A R SFLCTL SFLCTL(SFLRCD) 25/07/08
3800 A* 2/09/08
3900 A SFLSIZ(0015) 25/07/08
4000 A SFLPAG(0015) 25/07/08
4100 A OVERLAY 25/07/08
4200 A 21 SFLDSPCTL 25/07/08
4300 A 21 SFLDSP 25/07/08
4400 A N21 SFLCLR 25/07/08
4500 A 24 SFLEND(*MORE) 25/07/08
4600 A N24 PAGEDOWN 25/07/08
4700 A PAGEUP 25/07/08
4800 A* 18/07/08
4900 A 1 23′Work Remote’ 2/09/08
5000 A DSPATR(HI) 25/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRD 12/01/12 14:53:22 Page 2
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
5100 A 1 35′Writers(WRKRMTWTR)’ 2/09/08
5200 A DSPATR(HI) 25/07/08
5300 A 2 14′Selected:’ 25/07/08
5400 A FNDOUTQ 21A O 2 24DSPATR(UL) 25/07/08
5500 A 2 50′Found:’ 25/07/08
5600 A NBRFOUND 7Y 0O 2 57EDTCDE(1) 25/07/08
5700 A DSPATR(UL) 25/07/08
5800 A 6 1′Opt’ 25/07/08
5900 A DSPATR(HI) 25/07/08
6000 A 6 5′OutQ’ 25/07/08
6100 A DSPATR(HI) 25/07/08
6200 A 6 15′Library’ 25/07/08
6300 A DSPATR(HI) 25/07/08
6400 A 1 2SYSNAME 25/07/08
6500 A 2 2USER 25/07/08
6600 A 1 72DATE 25/07/08
6700 A EDTCDE(Y) 25/07/08
6800 A 2 72TIME 25/07/08
6900 A* 6/06/08
7000 A 4 2′1=StrRmtWtr’ 25/07/08
7100 A COLOR(BLU) 25/07/08
7200 A 4 15′2=ChgOutQ’ 25/07/08
7300 A COLOR(BLU) 25/07/08
7400 A 4 26′3=HldOutQ’ 25/07/08
7500 A COLOR(BLU) 25/07/08
7600 A 4 37′4=EndWtr’ 25/07/08
7700 A COLOR(BLU) 25/07/08
7800 A 4 47′5=WrkWtr’ 25/07/08
7900 A COLOR(BLU) 25/07/08
8000 A 4 57′6=RlsOutq’ 25/07/08
8100 A COLOR(BLU) 25/07/08
8200 A 4 68′8=WrkOutq’ 25/07/08
8300 A COLOR(BLU) 25/07/08
8400 A 5 2′D=Expanded Details’ 25/07/08
8500 A COLOR(BLU) 25/07/08
8600 A 5 22′P=Ping’ 25/07/08
8700 A COLOR(BLU) 25/07/08
8800 A* 11/07/08
8900 A 6 26′# Splf’ 25/07/08
9000 A DSPATR(HI) 25/07/08
9100 A 6 33′OSts’ 25/07/08
9200 A DSPATR(HI) 25/07/08
9300 A 6 38′IP Address/Host’ 25/07/08
9400 A DSPATR(HI) 25/07/08
9500 A 6 54′Rmt Queue’ 25/07/08
9600 A DSPATR(HI) 25/07/08
9700 A 6 65′WSCST’ 25/07/08
9800 A DSPATR(HI) 25/07/08
9900 A 6 76′WSts’ 25/07/08
10000 A DSPATR(HI) 25/07/08
10100 A* 2/06/08
10200 A R KEY 11/07/08
10300 A* 2/06/08
10400 A OVERLAY 17/07/08
10500 A 23 2′F3 = Exit’ 11/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRD 12/01/12 14:53:22 Page 3
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
10600 A COLOR(BLU) 11/07/08
10700 A 23 12′ F5 = Refresh F6 = CrtOutQ F9 - 11/07/08
10800 A = Command Line ‘ 11/07/08
10900 A COLOR(BLU) 11/07/08
11000 A 23 63′F10 = Qspl Sbs’ 11/07/08
11100 A COLOR(BLU) 11/07/08
11200 A* 2/09/08
11300 A R MSGSFL SFL 14/07/08
11400 A SFLMSGRCD(24) 14/07/08
11500 A BMSGK SFLMSGKEY 14/07/08
11600 A BPGMQ SFLPGMQ(10) 14/07/08
11700 A* 2/09/08
11800 A R MSGCTL SFLCTL(MSGSFL) 14/07/08
11900 A SFLSIZ(0002) 14/07/08
12000 A SFLPAG(0001) 14/07/08
12100 A SFLDSP 14/07/08
12200 A SFLDSPCTL 14/07/08
12300 A SFLINZ 14/07/08
12400 A N99 SFLEND 14/07/08
12500 A BPGMQ SFLPGMQ(10) 14/07/08
12600 A* 14/07/08
12700 A* 2/09/08
12800 A R MOREINFO 30/10/08
12900 A*%%TS SD 20081030 093938 DUBSYSBD01 REL-V5R3M0 5722-WDS 30/10/08
13000 A WINDOW(8 8 13 65 *NOMSGLIN) 30/10/08
13100 A OVERLAY 30/10/08
13200 A WDWBORDER((*DSPATR HI)) 30/10/08
13300 A WDWTITLE((*TEXT ‘Expanded Informati- 30/10/08
13400 A on for OutQ’) (*COLOR RED)) 30/10/08
13500 A 1 8′OutQ’ 30/10/08
13600 A DSPATR(HI) 30/10/08
13700 A OBJNAME 10A O 1 13 30/10/08
13800 A 1 26′Lib’ 30/10/08
13900 A DSPATR(HI) 30/10/08
14000 A OBJSLIB 10A O 1 30 30/10/08
14100 A 8 1′Remote Queue’ 30/10/08
14200 A DSPATR(HI) 30/10/08
14300 A XRMTQUE 60A O 9 2 30/10/08
14400 A 10 1′Remote System’ 30/10/08
14500 A DSPATR(HI) 30/10/08
14600 A XRMTSYS 60A O 11 2 30/10/08
14700 A 12 1′Text’ 30/10/08
14800 A DSPATR(HI) 30/10/08
14900 A XTEXT 50A O 13 2 30/10/08
15000 A 2 1′Writer: Job’ 30/10/08
15100 A DSPATR(HI) 30/10/08
15200 A WJOB 10A O 2 13 30/10/08
15300 A 2 25′User’ 30/10/08
15400 A DSPATR(HI) 30/10/08
15500 A WUSER 10A O 2 30 30/10/08
15600 A 2 42′Number’ 30/10/08
15700 A DSPATR(HI) 30/10/08
15800 A WNBR 6A O 2 49 30/10/08
15900 A 3 1′DestOptions’ 30/10/08
16000 A DSPATR(HI) 30/10/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRD 12/01/12 14:53:22 Page 4
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
16100 A DESTO 15A O 3 14 30/10/08
16200 A 3 31′NbrToAutoStart’ 30/10/08
16300 A DSPATR(HI) 30/10/08
16400 A AUTOS 2Y 0O 3 46EDTCDE(3) 30/10/08
16500 A 1 42′Status’ 30/10/08
16600 A DSPATR(HI) 30/10/08
16700 A OWSTS 8A O 1 49 30/10/08
16800 A 4 2′DtaQ’ 30/10/08
16900 A DSPATR(HI) 30/10/08
17000 A DTAQ 21A O 4 7 30/10/08
17100 A MSGQ 21A O 4 44 30/10/08
17200 A 3 50′DestType’ 30/10/08
17300 A DSPATR(HI) 30/10/08
17400 A DESTTYP 7A O 3 59 30/10/08
17500 A 5 1′WSCST’ 30/10/08
17600 A DSPATR(HI) 30/10/08
17700 A WSCSTOL 21A O 5 7 30/10/08
17800 A 5 31′UsrDtaTransf’ 30/10/08
17900 A DSPATR(HI) 30/10/08
18000 A DTATRNS 21A O 5 44 30/10/08
18100 A 4 31′MessageQueue’ 30/10/08
18200 A DSPATR(HI) 30/10/08
18300 A 6 1′MfgTypeModel’ 30/10/08
18400 A DSPATR(HI) 30/10/08
18500 A MFGTYPM 17A O 6 15 30/10/08
185 records copied to member or label *N in file QSYSPRT in library QSYS. 0 records excluded.
* * * * * E N D O F C O M P U T E R P R I N T O U T * * * * *

code 3/5 part 1
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 1
From file . . . . . : WRKRMTWTR/WRKRMTWTRS Member . . : WRKRMTWTRZ Record format . . . . . : @COPY
Record length . . . : 112
To file . . . . . . : *PRINT
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
100 H DFTACTGRP(*NO) BNDDIR(’QC2LE’) option(*SRCSTMT : *NODEBUGIO) 8/08/08
200 h CopyRight(’Bryan Dietz. 2©©8′) 30/08/08
300 * http://home.columbus.rr.com/jbmmdietz 2/09/08
400 * This is a complete rewrite from my first version. 2/09/08
500 * I am using a page-at-a-time subfile which removes the restriction 2/09/08
600 * of 9,999 outqs(subfile records) which a few people have run into. 2/09/08
700 * Enjoy this software, it was fun to write. If you want to improve it 2/09/08
800 * send me an email at the address below with your changes. 2/09/08
900 * If you just have a “I wish it could do this” send that along too. 2/09/08
1000 * Please remember that I wrote this as an exersise, and it did not cost you very much. 2/09/08
1100 * Thanks to all whose code snippets I used. 2/09/08
1200 2/09/08
1300 * There is some v5r3 code that has been commented out 31/08/08
1400 * I used the += and %subarr in the v5r3+ version 31/08/08
1500 * uncomment and recompile if you are now on v5r3+. 31/08/08
1600 * 31/08/08
1700 * COPYRIGHT 2008 Bryan Dietz bryandietz@yahoo.com 2/09/08
1800 * 31/08/08
1900 fWrkRmtWtrDcf e workstn USROPN 2/09/08
2000 f SFILE(SFLRCD:SFLCount) 8/08/08
2100 f INFDS(DisplayFB) 30/08/08
2200 25/07/08
2300 dDisplayFB ds 30/08/08
2400 d KeyPressed 1 overlay(DisplayFB :369) 30/08/08
2500 11/07/08
2600 D WrkRmtWtr PR ExtPgm(’WrkRmtWtrZ’) 31/08/08
2700 D OBJLIB 20A const 5/08/08
2800 D Sortby 1A const 5/08/08
2900 D Output 4a const OutPut(DISP/FILE) 5/08/08
3000 d outfilelib 20a const 5/08/08
3100 d fileopt 3a const (RPL or ADD) 5/08/08
3200 D WrkRmtWtr PI 31/08/08
3300 D OBJLIB 20A const 5/08/08
3400 D Sortby 1A const 5/08/08
3500 D Output 4a const OutPut(DISP/FILE) 5/08/08
3600 d outfilelib 20a const 5/08/08
3700 d fileopt 3a const (RPL or ADD) 5/08/08
3800 5/08/08
3900 dEnter c x’F1′ 11/07/08
4000 dPageUp c x’F4′ 11/07/08
4100 dPageDown c x’F5′ 11/07/08
4200 dReFresh c X’35′ 11/07/08
4300 dF6Crtoutq c X’36′ 21/07/08
4400 dF9CmdLn c X’39′ 21/07/08
4500 dF10Qspl c X’3A’ 21/07/08
4600 11/07/08
4700 *-> Create User Space 30/08/08
4800 D QUSCRTUS PR ExtPgm(’QUSCRTUS’) 12/06/08
4900 D UserSpace 20A const 12/06/08
5000 D ExtendedAttr 10A const 12/06/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 2
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
5100 D InitialSize 10I 0 const 12/06/08
5200 D InitialValue 1A const 12/06/08
5300 D PubAuth 10A const 30/08/08
5400 D Text 50A const 12/06/08
5500 D Replace 10A const 12/06/08
5600 D ErrorCode 32767A options(*varsize) 12/06/08
5700 12/06/08
5800 *-> Retrieve Pointer to User Space 30/08/08
5900 D QUSPTRUS PR ExtPgm(’QUSPTRUS’) 12/06/08
6000 D UserSpace 20A const 12/06/08
6100 D Pointer * 12/06/08
6200 12/06/08
6300 *-> Change User Space Attributes 30/08/08
6400 d QUSCUSAT PR extpgm(’QUSCUSAT’) 7/08/08
6500 d SpcLib 10A 12/06/08
6600 d SpcName 20A const 12/06/08
6700 d ChgAttrDS const likeds(ChgAttrDS) 12/06/08
6800 d ErrorCode 32767A options(*varsize) 12/06/08
6900 12/06/08
7000 d ChgAttrDS ds 12/06/08
7100 d NbrAttrs 10i 0 inz(1) 12/06/08
7200 d KeyValue 10i 0 inz(3) 12/06/08
7300 d DataSize 10i 0 inz(1) 12/06/08
7400 d DataValue 1 inz(’1′) 12/06/08
7500 30/08/08
7600 *-> Delete User Space 30/08/08
7700 D QUSDLTUS PR ExtPgm(’QUSDLTUS’) 12/06/08
7800 D UserSpace 20A const 12/06/08
7900 D ErrorCode 32767A options(*varsize) 12/06/08
8000 12/06/08
8100 *-> List Objects 30/08/08
8200 D QUSLOBJ PR ExtPgm(’QUSLOBJ’) 12/06/08
8300 D UserSpace 20A const 12/06/08
8400 D Format 8A const 12/06/08
8500 D QualObj 20A const 12/06/08
8600 d ObjType 10A const 12/06/08
8700 D ErrorCode 32767A options(*varsize: *nopass) 12/06/08
8800 12/06/08
8900 *-> Execute Command 30/08/08
9000 dQCMDEXC pr extpgm(’QCMDEXC’) 30/08/08
9100 d Command 65535 const options(*varsize) 11/07/08
9200 d CmdLength 15 5 const 11/07/08
9300 d IGC 3 const options(*nopass) 11/07/08
9400 11/07/08
9500 *-> Remove program messages 30/08/08
9600 D QMHRMVPM Pr ExtPgm( ‘QMHRMVPM’ ) 30/08/08
9700 D CallStackE 10a Const 30/08/08
9800 D CallStackC 10i 0 Const 30/08/08
9900 D MsgKey 4a Const 14/07/08
10000 D RmvOpt 10a Const 14/07/08
10100 D ErrorCode 32767a Options( *VarSize ) 30/08/08
10200 14/07/08
10300 *-> Send program message 30/08/08
10400 D QMHSNDPM PR ExtPgm(’QMHSNDPM’) 14/08/08
10500 D MsgId 7a const 30/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 3
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
10600 D MsgFL 20a const 30/08/08
10700 D MsgDta 32702a const options(*varsize) 30/08/08
10800 D DtaLen 10i 0 const 30/08/08
10900 D MsgType 10a const 30/08/08
11000 D CallStack 10a const 30/08/08
11100 D StackCount 10i 0 const 30/08/08
11200 D MsgKey 4a 30/08/08
11300 D ErrorCode 32767a options(*varsize) 30/08/08
11400 14/08/08
11500 *-> API Error Code Structure 30/08/08
11600 D ErrorCode DS qualified 12/06/08
11700 D BytesProv 10I 0 inz(0) 12/06/08
11800 D BytesAvail 10I 0 inz(0) 12/06/08
11900 6/08/08
12000 *-> Retrieve output queue information 30/08/08
12100 D QSPROUTQ Pr ExtPgm( ‘QSPROUTQ’ ) 7/08/08
12200 D RcvVar 32767a Options( *VarSize ) 7/08/08
12300 D RcvVarLen 10i 0 Const 7/08/08
12400 D FmtNam 8a Const 7/08/08
12500 D OutQue_q 20a Const 7/08/08
12600 D ErrorCode 32767a Options( *VarSize ) 30/08/08
12700 15/08/08
12800 *-> Retrieve System Status 30/08/08
12900 D QWCRSSTS PR ExtPgm(’QWCRSSTS’) 30/08/08
13000 D Reciever 80A 30/08/08
13100 D RcverLen 10I 0 30/08/08
13200 D Format 8A 30/08/08
13300 D ResetData 10A 30/08/08
13400 D ErrorCode 32767a Options( *VarSize ) 30/08/08
13500 15/08/08
13600 *-> QWCRSSTS (Retrieve System Info) API 30/08/08
13700 D SysStsRcv DS 80 30/08/08
13800 D BSysName 8A Overlay(SysStsRcv:17) 30/08/08
13900 D RcvLen S 10I 0 Inz(%Len(SysStsRcv)) 30/08/08
14000 D Format S 8A Inz(’SSTS0100′) 30/08/08
14100 D ResetStats S 10A Inz(’*YES’) 30/08/08
14200 7/08/08
14300 *-> Generic List API Header Info 30/08/08
14400 D BD1 DS based(p_BD1) 30/08/08
14500 D qualified 12/06/08
14600 D 124A 12/06/08
14700 D Offset1 10I 0 12/06/08
14800 D 10I 0 12/06/08
14900 D Count1 10I 0 12/06/08
15000 D Size1 10I 0 12/06/08
15100 12/06/08
15200 *-> Generic List API Header Info 30/08/08
15300 D BD2 DS based(p_BD2) 30/08/08
15400 D qualified 12/06/08
15500 D 124A 12/06/08
15600 D Offset2 10I 0 12/06/08
15700 D 10I 0 12/06/08
15800 D Count2 10I 0 12/06/08
15900 D Size2 10I 0 12/06/08
16000 12/06/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 4
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
16100 *-> List Entries returned by format JOBL0100 of QUSLOBJ API 30/08/08
16200 D OutQ1 ds qualified 12/06/08
16300 D based(p_OutQ1) 12/06/08
16400 D objnam 10A 12/06/08
16500 D objlib 10A 12/06/08
16600 D objtyp 10A 12/06/08
16700 12/06/08
16800 *-> Output queue information from QSPROUTQ API 30/08/08
16900 D OUTQ0100 Ds Qualified 12/06/08
17000 D BytRtn 10i 0 12/06/08
17100 D BytAvl 10i 0 12/06/08
17200 D OutQue_q 20a 12/06/08
17300 D OutQueNam 10a Overlay( OutQue_q: 1 ) 12/06/08
17400 D OutQueLib 10a Overlay( OutQue_q: 11 ) 12/06/08
17500 D FilOrd 10a 12/06/08
17600 D DspAnyF 10a 12/06/08
17700 D JobSep 10i 0 12/06/08
17800 D OprCtl 10a 12/06/08
17900 D DtaQueNam 10a 12/06/08
18000 D DtaQueLib 10a 12/06/08
18100 D AutChk 10a 12/06/08
18200 D NbrFil 10i 0 12/06/08
18300 D OutQueSts 10a 12/06/08
18400 D WtrJobNam 10a 12/06/08
18500 D WtrJobUsr 10a 12/06/08
18600 D WtrJobNbr 6a 12/06/08
18700 D WtrJobSts 10a 12/06/08
18800 D PrtDevNam 10a 12/06/08
18900 D OutQueTxt 50a 12/06/08
19000 D 2a 12/06/08
19100 D NbrSpfPag 10i 0 12/06/08
19200 D NbrWtrStr 10i 0 12/06/08
19300 D WtrAutStr 10i 0 12/06/08
19400 D RmtSystyp 1a 12/06/08
19500 D RmtSys 255a 12/06/08
19600 D RmtPrtQ 128a 12/06/08
19700 D MsgQname 10a 18/07/08
19800 D MsgQlib 10a 18/07/08
19900 D RMTCNN 10i 0 12/06/08
20000 D RMTDEST 10i 0 12/06/08
20100 D QSPMMVSC 1a 12/06/08
20200 D QSPFCB 8a 12/06/08
20300 D RMTTRNS 1a 12/06/08
20400 D MfgTypModl 17a 30/10/08
20500 D Wscst 10a 12/06/08
20600 D Wscstlib 10a 12/06/08
20700 D 13 12/06/08
20800 D DestOpts 128a 12/06/08
20900 D 284a 12/06/08
21000 21/07/08
21100 *-> Output queue information from QSPROUTQ API 30/08/08
21200 D OUTQ0200 Ds Qualified 21/07/08
21300 D LotsofJunk 1114a 30/08/08
21400 D DtaTransP 10a 21/07/08
21500 D DtaTransL 10a 21/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 5

code 3/5 part 2
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
21600 12/06/08
21700 *-> All the OutQ Stuff I find important 30/08/08
21800 D OutQ2 ds qualified 16/06/08
21900 D OPT 1A 16/06/08
22000 D OutQname 10A 16/06/08
22100 D OutQlib 10A 16/06/08
22200 D Nbrsplf 10i 0 16/06/08
22300 D OQsts 4A 16/06/08
22400 D OQip 75A 16/06/08
22500 D RmtQ 128A 16/06/08
22600 D MfgTypModl 17a 30/10/08
22700 D Wscst 10A 16/06/08
22800 D Wscstlib 10a 21/07/08
22900 D Wsts 4A 21/07/08
23000 D OQtext 50A 16/06/08
23100 D wJobNam 10a 15/07/08
23200 D wJobUsr 10a 15/07/08
23300 D wJobNbr 6a 15/07/08
23400 D DestOpts 50a 18/07/08
23500 D WtrAStr 10i 0 18/07/08
23600 D DqN 10a 18/07/08
23700 D DqL 10a 18/07/08
23800 D MqN 10a 18/07/08
23900 D MqL 10a 18/07/08
24000 D DestType 7a 18/07/08
24100 D DtaTransP 10a 21/07/08
24200 D DtaTransL 10a 21/07/08
24300 16/06/08
24400 *-> Arrary of outq’s stored in USerSpace 30/08/08
24500 D OutQdata s 500a dim(32767) based(oqDtaPtr) 21/07/08
24600 16/06/08
24700 *-> Misc. Variables 30/08/08
24800 D TmpUsrSpc1 C ‘OUTQLIB1 QTEMP’ 12/06/08
24900 D TmpUsrSpc2 C ‘OUTQLIB2 QTEMP’ 12/06/08
25000 d Tick c ”” 14/07/08
25100 d SFLCount s 4 0 18/07/08
25200 D entry1 s 10I 0 12/06/08
25300 D y s 10u 0 inz(1) 11/07/08
25400 d SpcLib s 10a 11/07/08
25500 d SFLPag s 10i 0 inz(15) 11/07/08
25600 d SFLMax s 10i 0 11/07/08
25700 d Cmd2Run s 512 15/07/08
25800 d ArrPos s 10i 0 inz(1) 15/07/08
25900 d ArrNbr s 10i 0 inz(1) 11/07/08
26000 d ListCount s 10i 0 inz(1) 11/07/08
26100 D sqlstm s 750 7/08/08
26200 D SysName s 8a 6/08/08
26300 D MsgKey s 4a 14/08/08
26400 6/08/08
26500 *-> Array for holding display selections 30/08/08
26600 d SaveArray ds 11/07/08
26700 d arr 25 dim(1000) 21/07/08
26800 d ArrOpt 1 OVERLAY(Arr: 1 ) Option Selected 21/07/08
26900 d ArrOL 20 OVERLAY(Arr: *next) Outq & Lib 21/07/08
27000 d arrO 10 OVERLAY(ArrOL: 1) Outq 21/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 6
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
27100 d arrL 10 OVERLAY(ArrOL: 11) Library 21/07/08
27200 d arrX 10i 0 OVERLAY(Arr: *next) Array position 21/07/08
27300 11/07/08
27400 *-> Bust up the input parms 30/08/08
27500 d inputparm ds 11/07/08
27600 d BmdOL 30 30/08/08
27700 d BmdO 10 OVERLAY(bmdOL: 1) 30/08/08
27800 d BmdL 10 OVERLAY(bmdOL: *next) 30/08/08
27900 d BmdX 10i 0 OVERLAY(bmdOL: *next) 30/08/08
28000 11/07/08
28100 *-> Bust up the input parms 30/08/08
28200 d Fileparm ds 30/07/08
28300 d FileLib 20 30/07/08
28400 d InFile 10 OVERLAY(FileLib: 1) 30/07/08
28500 d InLib 10 OVERLAY(FileLib: *next) 30/07/08
28600 30/08/08
28700 * ===================================================== 30/08/08
28800 /free 12/06/08
28900 BpgmQ = ‘*’; 30/08/08
29000 InputParm = objlib; 14/07/08
29100 FileParm = outfilelib; 30/07/08
29200 fndoutq = %trim(BmdL) + ‘/’ + %trim(BmdO); 30/08/08
29300 *inlr = *on; 30/07/08
29400 30/07/08
29500 Exsr CrtSpaces; 16/06/08
29600 Exsr ListOutqs; 16/06/08
29700 12/06/08
29800 // ================================================= 30/08/08
29900 if OutPut = ‘DISP’; 5/08/08
30000 open WrkRmtWtrD; 2/09/08
30100 dow *in03 = *off; // Test F3 for exit 31/08/08
30200 write SFLCtl; // Clear subfile 31/08/08
30300 11/07/08
30400 if NbrFound = 0; 11/07/08
30500 SFLCount = 1; 14/07/08
30600 ObjName = ‘*NotFound’; 14/07/08
30700 *in25 = *on; // Disallow input 31/08/08
30800 write SFLRcd; 14/07/08
30900 endif; 11/07/08
31000 11/07/08
31100 // Determine maximum number of SFL entries we can load 30/08/08
31200 if (ListCount + SFLPag) > NbrFound; 11/07/08
31300 SFLMax = (NbrFound - ListCount) + 1; 11/07/08
31400 else; 11/07/08
31500 SFLMax = SFLPAG; 11/07/08
31600 endif; 11/07/08
31700 13/08/08
31800 // Loop thru the output details “array” 13/08/08
31900 if sortby = ‘O’ and NbrFound > 0; 13/08/08
32000 // U N C O M M E N T I F A T V5R3+ 31/08/08
32100 // sorta %subarr(OutQdata:1:NbrFound); 31/08/08
32200 // U N C O M M E N T I F A T V5R3+ 31/08/08
32300 endif; 13/08/08
32400 13/08/08
32500 for SFLCount = 1 to SFLMax; 13/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 7
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
38100 endif; 21/07/08
38200 21/07/08
38300 if KeyPressed = F10Qspl; 25/07/08
38400 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
38500 exsr add2arr; 21/07/08
38600 Cmd2Run = ‘WrkActJob Sbs(qspl)’; 21/07/08
38700 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38800 Exsr StayonPage; 22/07/08
38900 endif; 21/07/08
39000 21/07/08
39100 if KeyPressed = Enter; 25/07/08
39200 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
39300 exsr add2arr; 14/07/08
39400 if arrpos > 1; 14/07/08
39500 exsr readarr; // Is there something to do? 31/08/08
39600 arrpos = 1; 14/07/08
39700 endif; 14/07/08
39800 Exsr StayonPage; 22/07/08
39900 endif; 14/07/08
40000 enddo; // Exit, cleanup and leave 31/08/08
40100 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 30/07/08
40200 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/07/08
40300 Close WrkRmtWtrD; 2/09/08
40400 return; 30/07/08
40500 endif; // Output = Display 31/08/08
40600 30/07/08
40700 // Start output to file. 30/08/08
40800 13/08/08
40900 if NbrFound = 0; 13/08/08
41000 Cmd2Run = ‘No Remote Writers found. ‘ + 31/08/08
41100 ‘I was asked to find ‘ + fndoutq; 31/08/08
41200 14/08/08
41300 QMHSNDPM( ‘CPF9898′ 14/08/08
41400 : ‘QCPFMSG QSYS ‘ 14/08/08
41500 : Cmd2Run 14/08/08
41600 : %len(Cmd2Run) 14/08/08
41700 : ‘*COMP’ 30/08/08
41800 : ‘*EXT’ 30/08/08
41900 : 0 14/08/08
42000 : MsgKey 14/08/08
42100 : ErrorCode ); 14/08/08
42200 QUSDLTUS(TmpUsrSpc1: ErrorCode ); // cleanup after yourself 30/08/08
42300 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/08/08
42400 return; // leave 30/08/08
42500 endif; 13/08/08
42600 30/08/08
42700 // Get the system name. This API is easier to code 31/08/08
42800 // for than using QWCRNETA API. 31/08/08
42900 QWCRSSTS(SysStsRcv 31/08/08
43000 : Rcvlen 31/08/08
43100 : Format 31/08/08
43200 : ResetStats 31/08/08
43300 : ErrorCode); 31/08/08
43400 15/08/08
43500 SysName= bSysName; 30/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 9

code 3/5 part 2
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
21600 12/06/08
21700 *-> All the OutQ Stuff I find important 30/08/08
21800 D OutQ2 ds qualified 16/06/08
21900 D OPT 1A 16/06/08
22000 D OutQname 10A 16/06/08
22100 D OutQlib 10A 16/06/08
22200 D Nbrsplf 10i 0 16/06/08
22300 D OQsts 4A 16/06/08
22400 D OQip 75A 16/06/08
22500 D RmtQ 128A 16/06/08
22600 D MfgTypModl 17a 30/10/08
22700 D Wscst 10A 16/06/08
22800 D Wscstlib 10a 21/07/08
22900 D Wsts 4A 21/07/08
23000 D OQtext 50A 16/06/08
23100 D wJobNam 10a 15/07/08
23200 D wJobUsr 10a 15/07/08
23300 D wJobNbr 6a 15/07/08
23400 D DestOpts 50a 18/07/08
23500 D WtrAStr 10i 0 18/07/08
23600 D DqN 10a 18/07/08
23700 D DqL 10a 18/07/08
23800 D MqN 10a 18/07/08
23900 D MqL 10a 18/07/08
24000 D DestType 7a 18/07/08
24100 D DtaTransP 10a 21/07/08
24200 D DtaTransL 10a 21/07/08
24300 16/06/08
24400 *-> Arrary of outq’s stored in USerSpace 30/08/08
24500 D OutQdata s 500a dim(32767) based(oqDtaPtr) 21/07/08
24600 16/06/08
24700 *-> Misc. Variables 30/08/08
24800 D TmpUsrSpc1 C ‘OUTQLIB1 QTEMP’ 12/06/08
24900 D TmpUsrSpc2 C ‘OUTQLIB2 QTEMP’ 12/06/08
25000 d Tick c ”” 14/07/08
25100 d SFLCount s 4 0 18/07/08
25200 D entry1 s 10I 0 12/06/08
25300 D y s 10u 0 inz(1) 11/07/08
25400 d SpcLib s 10a 11/07/08
25500 d SFLPag s 10i 0 inz(15) 11/07/08
25600 d SFLMax s 10i 0 11/07/08
25700 d Cmd2Run s 512 15/07/08
25800 d ArrPos s 10i 0 inz(1) 15/07/08
25900 d ArrNbr s 10i 0 inz(1) 11/07/08
26000 d ListCount s 10i 0 inz(1) 11/07/08
26100 D sqlstm s 750 7/08/08
26200 D SysName s 8a 6/08/08
26300 D MsgKey s 4a 14/08/08
26400 6/08/08
26500 *-> Array for holding display selections 30/08/08
26600 d SaveArray ds 11/07/08
26700 d arr 25 dim(1000) 21/07/08
26800 d ArrOpt 1 OVERLAY(Arr: 1 ) Option Selected 21/07/08
26900 d ArrOL 20 OVERLAY(Arr: *next) Outq & Lib 21/07/08
27000 d arrO 10 OVERLAY(ArrOL: 1) Outq 21/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 6
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
27100 d arrL 10 OVERLAY(ArrOL: 11) Library 21/07/08
27200 d arrX 10i 0 OVERLAY(Arr: *next) Array position 21/07/08
27300 11/07/08
27400 *-> Bust up the input parms 30/08/08
27500 d inputparm ds 11/07/08
27600 d BmdOL 30 30/08/08
27700 d BmdO 10 OVERLAY(bmdOL: 1) 30/08/08
27800 d BmdL 10 OVERLAY(bmdOL: *next) 30/08/08
27900 d BmdX 10i 0 OVERLAY(bmdOL: *next) 30/08/08
28000 11/07/08
28100 *-> Bust up the input parms 30/08/08
28200 d Fileparm ds 30/07/08
28300 d FileLib 20 30/07/08
28400 d InFile 10 OVERLAY(FileLib: 1) 30/07/08
28500 d InLib 10 OVERLAY(FileLib: *next) 30/07/08
28600 30/08/08
28700 * ===================================================== 30/08/08
28800 /free 12/06/08
28900 BpgmQ = ‘*’; 30/08/08
29000 InputParm = objlib; 14/07/08
29100 FileParm = outfilelib; 30/07/08
29200 fndoutq = %trim(BmdL) + ‘/’ + %trim(BmdO); 30/08/08
29300 *inlr = *on; 30/07/08
29400 30/07/08
29500 Exsr CrtSpaces; 16/06/08
29600 Exsr ListOutqs; 16/06/08
29700 12/06/08
29800 // ================================================= 30/08/08
29900 if OutPut = ‘DISP’; 5/08/08
30000 open WrkRmtWtrD; 2/09/08
30100 dow *in03 = *off; // Test F3 for exit 31/08/08
30200 write SFLCtl; // Clear subfile 31/08/08
30300 11/07/08
30400 if NbrFound = 0; 11/07/08
30500 SFLCount = 1; 14/07/08
30600 ObjName = ‘*NotFound’; 14/07/08
30700 *in25 = *on; // Disallow input 31/08/08
30800 write SFLRcd; 14/07/08
30900 endif; 11/07/08
31000 11/07/08
31100 // Determine maximum number of SFL entries we can load 30/08/08
31200 if (ListCount + SFLPag) > NbrFound; 11/07/08
31300 SFLMax = (NbrFound - ListCount) + 1; 11/07/08
31400 else; 11/07/08
31500 SFLMax = SFLPAG; 11/07/08
31600 endif; 11/07/08
31700 13/08/08
31800 // Loop thru the output details “array” 13/08/08
31900 if sortby = ‘O’ and NbrFound > 0; 13/08/08
32000 // U N C O M M E N T I F A T V5R3+ 31/08/08
32100 // sorta %subarr(OutQdata:1:NbrFound); 31/08/08
32200 // U N C O M M E N T I F A T V5R3+ 31/08/08
32300 endif; 13/08/08
32400 13/08/08
32500 for SFLCount = 1 to SFLMax; 13/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 7
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8

Code 3/5 part 2.
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
21600 12/06/08
21700 *-> All the OutQ Stuff I find important 30/08/08
21800 D OutQ2 ds qualified 16/06/08
21900 D OPT 1A 16/06/08
22000 D OutQname 10A 16/06/08
22100 D OutQlib 10A 16/06/08
22200 D Nbrsplf 10i 0 16/06/08
22300 D OQsts 4A 16/06/08
22400 D OQip 75A 16/06/08
22500 D RmtQ 128A 16/06/08
22600 D MfgTypModl 17a 30/10/08
22700 D Wscst 10A 16/06/08
22800 D Wscstlib 10a 21/07/08
22900 D Wsts 4A 21/07/08
23000 D OQtext 50A 16/06/08
23100 D wJobNam 10a 15/07/08
23200 D wJobUsr 10a 15/07/08
23300 D wJobNbr 6a 15/07/08
23400 D DestOpts 50a 18/07/08
23500 D WtrAStr 10i 0 18/07/08
23600 D DqN 10a 18/07/08
23700 D DqL 10a 18/07/08
23800 D MqN 10a 18/07/08
23900 D MqL 10a 18/07/08
24000 D DestType 7a 18/07/08
24100 D DtaTransP 10a 21/07/08
24200 D DtaTransL 10a 21/07/08
24300 16/06/08
24400 *-> Arrary of outq’s stored in USerSpace 30/08/08
24500 D OutQdata s 500a dim(32767) based(oqDtaPtr) 21/07/08
24600 16/06/08
24700 *-> Misc. Variables 30/08/08
24800 D TmpUsrSpc1 C ‘OUTQLIB1 QTEMP’ 12/06/08
24900 D TmpUsrSpc2 C ‘OUTQLIB2 QTEMP’ 12/06/08
25000 d Tick c ”” 14/07/08
25100 d SFLCount s 4 0 18/07/08
25200 D entry1 s 10I 0 12/06/08
25300 D y s 10u 0 inz(1) 11/07/08
25400 d SpcLib s 10a 11/07/08
25500 d SFLPag s 10i 0 inz(15) 11/07/08
25600 d SFLMax s 10i 0 11/07/08
25700 d Cmd2Run s 512 15/07/08
25800 d ArrPos s 10i 0 inz(1) 15/07/08
25900 d ArrNbr s 10i 0 inz(1) 11/07/08
26000 d ListCount s 10i 0 inz(1) 11/07/08
26100 D sqlstm s 750 7/08/08
26200 D SysName s 8a 6/08/08
26300 D MsgKey s 4a 14/08/08
26400 6/08/08
26500 *-> Array for holding display selections 30/08/08
26600 d SaveArray ds 11/07/08
26700 d arr 25 dim(1000) 21/07/08
26800 d ArrOpt 1 OVERLAY(Arr: 1 ) Option Selected 21/07/08
26900 d ArrOL 20 OVERLAY(Arr: *next) Outq & Lib 21/07/08
27000 d arrO 10 OVERLAY(ArrOL: 1) Outq 21/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 6
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
27100 d arrL 10 OVERLAY(ArrOL: 11) Library 21/07/08
27200 d arrX 10i 0 OVERLAY(Arr: *next) Array position 21/07/08
27300 11/07/08
27400 *-> Bust up the input parms 30/08/08
27500 d inputparm ds 11/07/08
27600 d BmdOL 30 30/08/08
27700 d BmdO 10 OVERLAY(bmdOL: 1) 30/08/08
27800 d BmdL 10 OVERLAY(bmdOL: *next) 30/08/08
27900 d BmdX 10i 0 OVERLAY(bmdOL: *next) 30/08/08
28000 11/07/08
28100 *-> Bust up the input parms 30/08/08
28200 d Fileparm ds 30/07/08
28300 d FileLib 20 30/07/08
28400 d InFile 10 OVERLAY(FileLib: 1) 30/07/08
28500 d InLib 10 OVERLAY(FileLib: *next) 30/07/08
28600 30/08/08
28700 * ===================================================== 30/08/08
28800 /free 12/06/08
28900 BpgmQ = ‘*’; 30/08/08
29000 InputParm = objlib; 14/07/08
29100 FileParm = outfilelib; 30/07/08
29200 fndoutq = %trim(BmdL) + ‘/’ + %trim(BmdO); 30/08/08
29300 *inlr = *on; 30/07/08
29400 30/07/08
29500 Exsr CrtSpaces; 16/06/08
29600 Exsr ListOutqs; 16/06/08
29700 12/06/08
29800 // ================================================= 30/08/08
29900 if OutPut = ‘DISP’; 5/08/08
30000 open WrkRmtWtrD; 2/09/08
30100 dow *in03 = *off; // Test F3 for exit 31/08/08
30200 write SFLCtl; // Clear subfile 31/08/08
30300 11/07/08
30400 if NbrFound = 0; 11/07/08
30500 SFLCount = 1; 14/07/08
30600 ObjName = ‘*NotFound’; 14/07/08
30700 *in25 = *on; // Disallow input 31/08/08
30800 write SFLRcd; 14/07/08
30900 endif; 11/07/08
31000 11/07/08
31100 // Determine maximum number of SFL entries we can load 30/08/08
31200 if (ListCount + SFLPag) > NbrFound; 11/07/08
31300 SFLMax = (NbrFound - ListCount) + 1; 11/07/08
31400 else; 11/07/08
31500 SFLMax = SFLPAG; 11/07/08
31600 endif; 11/07/08
31700 13/08/08
31800 // Loop thru the output details “array” 13/08/08
31900 if sortby = ‘O’ and NbrFound > 0; 13/08/08
32000 // U N C O M M E N T I F A T V5R3+ 31/08/08
32100 // sorta %subarr(OutQdata:1:NbrFound); 31/08/08
32200 // U N C O M M E N T I F A T V5R3+ 31/08/08
32300 endif; 13/08/08
32400 13/08/08
32500 for SFLCount = 1 to SFLMax; 13/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 7
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
38100 endif; 21/07/08
38200 21/07/08
38300 if KeyPressed = F10Qspl; 25/07/08
38400 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
38500 exsr add2arr; 21/07/08
38600 Cmd2Run = ‘WrkActJob Sbs(qspl)’; 21/07/08
38700 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38800 Exsr StayonPage; 22/07/08
38900 endif; 21/07/08
39000 21/07/08
39100 if KeyPressed = Enter; 25/07/08
39200 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
39300 exsr add2arr; 14/07/08
39400 if arrpos > 1; 14/07/08
39500 exsr readarr; // Is there something to do? 31/08/08
39600 arrpos = 1; 14/07/08
39700 endif; 14/07/08
39800 Exsr StayonPage; 22/07/08
39900 endif; 14/07/08
40000 enddo; // Exit, cleanup and leave 31/08/08
40100 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 30/07/08
40200 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/07/08
40300 Close WrkRmtWtrD; 2/09/08
40400 return; 30/07/08
40500 endif; // Output = Display 31/08/08
40600 30/07/08
40700 // Start output to file. 30/08/08
40800 13/08/08
40900 if NbrFound = 0; 13/08/08
41000 Cmd2Run = ‘No Remote Writers found. ‘ + 31/08/08
41100 ‘I was asked to find ‘ + fndoutq; 31/08/08
41200 14/08/08
41300 QMHSNDPM( ‘CPF9898′ 14/08/08
41400 : ‘QCPFMSG QSYS ‘ 14/08/08
41500 : Cmd2Run 14/08/08
41600 : %len(Cmd2Run) 14/08/08
41700 : ‘*COMP’ 30/08/08
41800 : ‘*EXT’ 30/08/08
41900 : 0 14/08/08
42000 : MsgKey 14/08/08
42100 : ErrorCode ); 14/08/08
42200 QUSDLTUS(TmpUsrSpc1: ErrorCode ); // cleanup after yourself 30/08/08
42300 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/08/08
42400 return; // leave 30/08/08
42500 endif; 13/08/08
42600 30/08/08
42700 // Get the system name. This API is easier to code 31/08/08
42800 // for than using QWCRNETA API. 31/08/08
42900 QWCRSSTS(SysStsRcv 31/08/08
43000 : Rcvlen 31/08/08
43100 : Format 31/08/08
43200 : ResetStats 31/08/08
43300 : ErrorCode); 31/08/08
43400 15/08/08
43500 SysName= bSysName; 30/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 9

OK guys, I am having a nightmare with this site as I keep posting up items like the rest of the code and it never appears. I must have done it about 5 times at least today and I cannot spend anymore time trying at the moment. If anyone else has an email address or suggestions I am happy to share the code with them or try that later.
The site now is even coming up and saying I have posted duplicate items on there and yet the item is not showing up.

try again !
Code 3/5 part 2
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
21600 12/06/08
21700 *-> All the OutQ Stuff I find important 30/08/08
21800 D OutQ2 ds qualified 16/06/08
21900 D OPT 1A 16/06/08
22000 D OutQname 10A 16/06/08
22100 D OutQlib 10A 16/06/08
22200 D Nbrsplf 10i 0 16/06/08
22300 D OQsts 4A 16/06/08
22400 D OQip 75A 16/06/08
22500 D RmtQ 128A 16/06/08
22600 D MfgTypModl 17a 30/10/08
22700 D Wscst 10A 16/06/08
22800 D Wscstlib 10a 21/07/08
22900 D Wsts 4A 21/07/08
23000 D OQtext 50A 16/06/08
23100 D wJobNam 10a 15/07/08
23200 D wJobUsr 10a 15/07/08
23300 D wJobNbr 6a 15/07/08
23400 D DestOpts 50a 18/07/08
23500 D WtrAStr 10i 0 18/07/08
23600 D DqN 10a 18/07/08
23700 D DqL 10a 18/07/08
23800 D MqN 10a 18/07/08
23900 D MqL 10a 18/07/08
24000 D DestType 7a 18/07/08
24100 D DtaTransP 10a 21/07/08
24200 D DtaTransL 10a 21/07/08
24300 16/06/08
24400 *-> Arrary of outq’s stored in USerSpace 30/08/08
24500 D OutQdata s 500a dim(32767) based(oqDtaPtr) 21/07/08
24600 16/06/08
24700 *-> Misc. Variables 30/08/08
24800 D TmpUsrSpc1 C ‘OUTQLIB1 QTEMP’ 12/06/08
24900 D TmpUsrSpc2 C ‘OUTQLIB2 QTEMP’ 12/06/08
25000 d Tick c ”” 14/07/08
25100 d SFLCount s 4 0 18/07/08
25200 D entry1 s 10I 0 12/06/08
25300 D y s 10u 0 inz(1) 11/07/08
25400 d SpcLib s 10a 11/07/08
25500 d SFLPag s 10i 0 inz(15) 11/07/08
25600 d SFLMax s 10i 0 11/07/08
25700 d Cmd2Run s 512 15/07/08
25800 d ArrPos s 10i 0 inz(1) 15/07/08
25900 d ArrNbr s 10i 0 inz(1) 11/07/08
26000 d ListCount s 10i 0 inz(1) 11/07/08
26100 D sqlstm s 750 7/08/08
26200 D SysName s 8a 6/08/08
26300 D MsgKey s 4a 14/08/08
26400 6/08/08
26500 *-> Array for holding display selections 30/08/08
26600 d SaveArray ds 11/07/08
26700 d arr 25 dim(1000) 21/07/08
26800 d ArrOpt 1 OVERLAY(Arr: 1 ) Option Selected 21/07/08
26900 d ArrOL 20 OVERLAY(Arr: *next) Outq & Lib 21/07/08
27000 d arrO 10 OVERLAY(ArrOL: 1) Outq 21/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 6
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
27100 d arrL 10 OVERLAY(ArrOL: 11) Library 21/07/08
27200 d arrX 10i 0 OVERLAY(Arr: *next) Array position 21/07/08
27300 11/07/08
27400 *-> Bust up the input parms 30/08/08
27500 d inputparm ds 11/07/08
27600 d BmdOL 30 30/08/08
27700 d BmdO 10 OVERLAY(bmdOL: 1) 30/08/08
27800 d BmdL 10 OVERLAY(bmdOL: *next) 30/08/08
27900 d BmdX 10i 0 OVERLAY(bmdOL: *next) 30/08/08
28000 11/07/08
28100 *-> Bust up the input parms 30/08/08
28200 d Fileparm ds 30/07/08
28300 d FileLib 20 30/07/08
28400 d InFile 10 OVERLAY(FileLib: 1) 30/07/08
28500 d InLib 10 OVERLAY(FileLib: *next) 30/07/08
28600 30/08/08
28700 * ===================================================== 30/08/08
28800 /free 12/06/08
28900 BpgmQ = ‘*’; 30/08/08
29000 InputParm = objlib; 14/07/08
29100 FileParm = outfilelib; 30/07/08
29200 fndoutq = %trim(BmdL) + ‘/’ + %trim(BmdO); 30/08/08
29300 *inlr = *on; 30/07/08
29400 30/07/08
29500 Exsr CrtSpaces; 16/06/08
29600 Exsr ListOutqs; 16/06/08
29700 12/06/08
29800 // ================================================= 30/08/08
29900 if OutPut = ‘DISP’; 5/08/08
30000 open WrkRmtWtrD; 2/09/08
30100 dow *in03 = *off; // Test F3 for exit 31/08/08
30200 write SFLCtl; // Clear subfile 31/08/08
30300 11/07/08
30400 if NbrFound = 0; 11/07/08
30500 SFLCount = 1; 14/07/08
30600 ObjName = ‘*NotFound’; 14/07/08
30700 *in25 = *on; // Disallow input 31/08/08
30800 write SFLRcd; 14/07/08
30900 endif; 11/07/08
31000 11/07/08
31100 // Determine maximum number of SFL entries we can load 30/08/08
31200 if (ListCount + SFLPag) > NbrFound; 11/07/08
31300 SFLMax = (NbrFound - ListCount) + 1; 11/07/08
31400 else; 11/07/08
31500 SFLMax = SFLPAG; 11/07/08
31600 endif; 11/07/08
31700 13/08/08
31800 // Loop thru the output details “array” 13/08/08
31900 if sortby = ‘O’ and NbrFound > 0; 13/08/08
32000 // U N C O M M E N T I F A T V5R3+ 31/08/08
32100 // sorta %subarr(OutQdata:1:NbrFound); 31/08/08
32200 // U N C O M M E N T I F A T V5R3+ 31/08/08
32300 endif; 13/08/08
32400 13/08/08
32500 for SFLCount = 1 to SFLMax; 13/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 7

code 3/5 part 3
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
38100 endif; 21/07/08
38200 21/07/08
38300 if KeyPressed = F10Qspl; 25/07/08
38400 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
38500 exsr add2arr; 21/07/08
38600 Cmd2Run = ‘WrkActJob Sbs(qspl)’; 21/07/08
38700 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38800 Exsr StayonPage; 22/07/08
38900 endif; 21/07/08
39000 21/07/08
39100 if KeyPressed = Enter; 25/07/08
39200 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
39300 exsr add2arr; 14/07/08
39400 if arrpos > 1; 14/07/08
39500 exsr readarr; // Is there something to do? 31/08/08
39600 arrpos = 1; 14/07/08
39700 endif; 14/07/08
39800 Exsr StayonPage; 22/07/08
39900 endif; 14/07/08
40000 enddo; // Exit, cleanup and leave 31/08/08
40100 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 30/07/08
40200 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/07/08
40300 Close WrkRmtWtrD; 2/09/08
40400 return; 30/07/08
40500 endif; // Output = Display 31/08/08
40600 30/07/08
40700 // Start output to file. 30/08/08
40800 13/08/08
40900 if NbrFound = 0; 13/08/08
41000 Cmd2Run = ‘No Remote Writers found. ‘ + 31/08/08
41100 ‘I was asked to find ‘ + fndoutq; 31/08/08
41200 14/08/08
41300 QMHSNDPM( ‘CPF9898′ 14/08/08
41400 : ‘QCPFMSG QSYS ‘ 14/08/08
41500 : Cmd2Run 14/08/08
41600 : %len(Cmd2Run) 14/08/08
41700 : ‘*COMP’ 30/08/08
41800 : ‘*EXT’ 30/08/08
41900 : 0 14/08/08
42000 : MsgKey 14/08/08
42100 : ErrorCode ); 14/08/08
42200 QUSDLTUS(TmpUsrSpc1: ErrorCode ); // cleanup after yourself 30/08/08
42300 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/08/08
42400 return; // leave 30/08/08
42500 endif; 13/08/08
42600 30/08/08
42700 // Get the system name. This API is easier to code 31/08/08
42800 // for than using QWCRNETA API. 31/08/08
42900 QWCRSSTS(SysStsRcv 31/08/08
43000 : Rcvlen 31/08/08
43100 : Format 31/08/08
43200 : ResetStats 31/08/08
43300 : ErrorCode); 31/08/08
43400 15/08/08
43500 SysName= bSysName; 30/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 9

seems to work it I break it up

code 3/5 p3
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
38100 endif; 21/07/08
38200 21/07/08
38300 if KeyPressed = F10Qspl; 25/07/08
38400 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
38500 exsr add2arr; 21/07/08
38600 Cmd2Run = ‘WrkActJob Sbs(qspl)’; 21/07/08
38700 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38800 Exsr StayonPage; 22/07/08
38900 endif; 21/07/08
39000 21/07/08
39100 if KeyPressed = Enter; 25/07/08
39200 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
39300 exsr add2arr; 14/07/08
39400 if arrpos > 1; 14/07/08
39500 exsr readarr; // Is there something to do? 31/08/08
39600 arrpos = 1; 14/07/08
39700 endif; 14/07/08
39800 Exsr StayonPage; 22/07/08
39900 endif; 14/07/08
40000 enddo; // Exit, cleanup and leave 31/08/08
40100 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 30/07/08
40200 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/07/08
40300 Close WrkRmtWtrD; 2/09/08
40400 return; 30/07/08
40500 endif; // Output = Display 31/08/08
40600 30/07/08
40700 // Start output to file. 30/08/08
40800 13/08/08
40900 if NbrFound = 0; 13/08/08
41000 Cmd2Run = ‘No Remote Writers found. ‘ + 31/08/08
41100 ‘I was asked to find ‘ + fndoutq; 31/08/08
41200 14/08/08
41300 QMHSNDPM( ‘CPF9898′ 14/08/08
41400 : ‘QCPFMSG QSYS ‘ 14/08/08
41500 : Cmd2Run 14/08/08
41600 : %len(Cmd2Run) 14/08/08
41700 : ‘*COMP’ 30/08/08
41800 : ‘*EXT’ 30/08/08
41900 : 0 14/08/08
42000 : MsgKey 14/08/08
42100 : ErrorCode ); 14/08/08
42200 QUSDLTUS(TmpUsrSpc1: ErrorCode ); // cleanup after yourself 30/08/08
42300 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 30/08/08
42400 return; // leave 30/08/08
42500 endif; 13/08/08
42600 30/08/08
42700 // Get the system name. This API is easier to code 31/08/08
42800 // for than using QWCRNETA API. 31/08/08
42900 QWCRSSTS(SysStsRcv 31/08/08
43000 : Rcvlen 31/08/08
43100 : Format 31/08/08
43200 : ResetStats 31/08/08
43300 : ErrorCode); 31/08/08
43400 15/08/08
43500 SysName= bSysName; 30/08/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 9

code 3/5 p3
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
32600 OutQ2 = OutQdata(y); 13/08/08
32700 exsr Add2sfl; 13/08/08
32800 y = y + 1; 2/09/08
32900 // y += 1; // v5r3 notation 2/09/08
33000 // listcount += 1; // v5r3 notation 2/09/08
33100 listcount = listcount + 1; 31/08/08
33200 endfor; 13/08/08
33300 13/08/08
33400 // Still more to process? 30/08/08
33500 if ListCount > NbrFound; 25/07/08
33600 *in24 = *on; // Show ‘Bottom’ 25/07/08
33700 else; 11/07/08
33800 *in24 = *off; // Show ‘More’ 25/07/08
33900 endif; 11/07/08
34000 11/07/08
34100 *in21 = *on; 25/07/08
34200 write msgctl; 17/07/08
34300 write Key; 17/07/08
34400 exfmt SFLCtl; // Display subfile 25/07/08
34500 *in21 = *off; 11/07/08
34600 25/07/08
34700 // OK, back from the display. Is there anything to do? 25/07/08
34800 11/07/08
34900 if KeyPressed = Refresh; 25/07/08
35000 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
35100 exsr RefreshSfl; // Start over 30/07/08
35200 endif; 11/07/08
35300 11/07/08
35400 if KeyPressed = PageUp; 25/07/08
35500 exsr add2arr; 11/07/08
35600 ListCount = (ListCount - SFLMax - SFLPag); 22/07/08
35700 if ListCount < 1; 22/07/08
35800 ListCount = 1; 22/07/08
35900 endif; 22/07/08
36000 y = ListCount; 22/07/08
36100 endif; 11/07/08
36200 11/07/08
36300 if KeyPressed = PageDown; 25/07/08
36400 exsr add2arr; 14/07/08
36500 endif; 14/07/08
36600 11/07/08
36700 if KeyPressed = F6CrtOutq; 25/07/08
36800 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
36900 exsr add2arr; 21/07/08
37000 Cmd2Run = ‘?CrtOutq’; 21/07/08
37100 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
37200 Exsr StayonPage; 22/07/08
37300 endif; 21/07/08
37400 21/07/08
37500 if KeyPressed = F9CmdLn; 25/07/08
37600 QMHRMVPM( ‘*’: *Zero: *Blanks: ‘*OLD’: ErrorCode ); 30/08/08
37700 exsr add2arr; 21/07/08
37800 Cmd2Run = ‘Call QusCmdLn’; 21/07/08
37900 CallP(e) QCMDEXC(Cmd2Run :%len(%trimr(Cmd2Run))); 30/08/08
38000 Exsr StayonPage; 22/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 8

…seems to work it I break it up…
In the past, I thought that there was around 200 lines of code as a limit.
Since this site really isn’t a code repository, that doesn’t seem too troublesome overall. It can be frustrating, though, for specific items. That’s one reason why sites like pastebin are handy.
Tom

Code 3 part 4
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
43600 13/08/08
43700 Exsr Output2File; 5/08/08
43800 30/07/08
43900 if sortby = ‘O’; 31/08/08
44000 // U N C O M M E N T I F A T V5R3+ 31/08/08
44100 // sorta %subarr(OutQdata:1:NbrFound); 31/08/08
44200 // U N C O M M E N T I F A T V5R3+ 31/08/08
44300 endif; 13/08/08
44400 13/08/08
44500 for y = 1 to NbrFound; 13/08/08
44600 OutQ2 = OutQdata(y); 13/08/08
44700 Exsr Write2File; 13/08/08
44800 endfor; 13/08/08
44900 30/07/08
45000 // Delete user spaces & end program 16/06/08
45100 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 12/06/08
45200 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 12/06/08
45300 return; 11/07/08
45400 15/08/08
45500 // *===================================================* 25/07/08
45600 // * S_u_b_r_o_u_t_i_n_e_s 31/08/08
45700 // *===================================================* 31/08/08
45800 13/08/08
45900 Begsr RefreshSfl; // Refresh = F5 30/07/08
46000 25/07/08
46100 clear OutQdata; 25/07/08
46200 QUSDLTUS(TmpUsrSpc1: ErrorCode ); 25/07/08
46300 QUSDLTUS(TmpUsrSpc2: ErrorCode ); 25/07/08
46400 NbrFound = 0; 31/08/08
46500 arrpos = 1; 31/08/08
46600 ListCount = 1; 31/08/08
46700 bmdsav = 1; 31/08/08
46800 y = 1; 31/08/08
46900 Exsr CrtSpaces; 25/07/08
47000 Exsr ListOutqs; 25/07/08
47100 25/07/08
47200 endsr; 11/07/08
47300 18/07/08
47400 Begsr Add2Sfl; // Add the records to the subfile 18/07/08
47500 ObjName = OutQ2.OutQname; 31/08/08
47600 ObjsLib = OutQ2.OutQlib; 31/08/08
47700 NbrSplf = OutQ2.Nbrsplf; 31/08/08
47800 OQSTS = ‘HELD’; 11/07/08
47900 if OutQ2.OQsts = ‘RELE’; 31/08/08
48000 OQSTS = ‘RLSD’; 11/07/08
48100 endif; 11/07/08
48200 OQIP = OutQ2.OQip; 31/08/08
48300 RMTQ = OutQ2.RmtQ; 31/08/08
48400 WSCST = OutQ2.Wscst; 31/08/08
48500 if OutQ2.WSCST = ‘*NONE’; 30/10/08
48600 WSCST = OutQ2.MfgTypModl; 30/10/08
48700 endif; 30/10/08
48800 WSTS = OutQ2.Wsts; 31/08/08
48900 bmdsav = listcount; 15/07/08
49000 write SFLRcd; 11/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 10
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
49100 endsr; 11/07/08
49200 11/07/08
49300 25/07/08
49400 Begsr GetOutqDtls; // Get the details for the outq 25/07/08
49500 25/07/08
49600 QSPROUTQ( OUTQ0100 12/06/08
49700 : %Size( OUTQ0100 ) 12/06/08
49800 : ‘OUTQ0100′ 12/06/08
49900 : OutQ1.objnam + OutQ1.objlib 12/06/08
50000 : ErrorCode); 12/06/08
50100 12/06/08
50200 if OUTQ0100.RMTCNN = 2; // IP defined outq 31/08/08
50300 If ErrorCode.BytesAvail = *Zero; 12/06/08
50400 // NbrFound += 1; // v5r3 notation 2/09/08
50500 NbrFound = NbrFound + 1; 31/08/08
50600 OutQ2.OPT = ‘ ‘; 31/08/08
50700 QSPROUTQ( OUTQ0200 // Get additional details for the outq 31/08/08
50800 : %Size( OUTQ0200 ) 21/07/08
50900 : ‘OUTQ0200′ 21/07/08
51000 : OutQ1.objnam + OutQ1.objlib 21/07/08
51100 : ErrorCode); 21/07/08
51200 Exsr MoveData; 18/07/08
51300 OutQData( NbrFound ) = OutQ2; 31/08/08
51400 EndIf; 12/06/08
51500 EndIf; 12/06/08
51600 endsr; 12/06/08
51700 12/06/08
51800 Begsr CrtSpaces; // Create a user space #1 31/08/08
51900 QUSCRTUS( TmpUsrSpc1 12/06/08
52000 : ‘OUTQs1′ 12/06/08
52100 : %size(OutQ1) 12/06/08
52200 : x’00′ 12/06/08
52300 : ‘*ALL’ 12/06/08
52400 : ‘List of OutPut Queues’ 12/06/08
52500 : ‘*YES’ 12/06/08
52600 : ErrorCode ); 12/06/08
52700 12/06/08
52800 // Change the user space to be automatically extendable 16/06/08
52900 QUSCUSAT( SpcLib 18/07/08
53000 :TmpUsrSpc1 31/08/08
53100 :ChgAttrDS 31/08/08
53200 :ErrorCode ); 31/08/08
53300 12/06/08
53400 // Create a user space #2 16/06/08
53500 QUSCRTUS( TmpUsrSpc2 12/06/08
53600 : ‘OUTQs2′ 12/06/08
53700 : %size(OutQ1) 12/06/08
53800 : x’00′ 12/06/08
53900 : ‘*ALL’ 12/06/08
54000 : ‘Data for OutPut Queues’ 12/06/08
54100 : ‘*YES’ 12/06/08
54200 : ErrorCode ); 12/06/08
54300 12/06/08
54400 // Change the user space to be automatically extendable 16/06/08
54500 QUSCUSAT( SpcLib 18/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 11
SEQNBR *…+… 1 …+… 2 …+… 3 …+… 4 …+… 5 …+… 6 …+… 7 …+… 8 …+… 9 …+… 0 DATE
54600 :TmpUsrSpc2 15/08/08
54700 :ChgAttrDS 15/08/08
54800 :ErrorCode ); 15/08/08
54900 12/06/08
55000 // Get a pointer to the start of the outq list 18/07/08
55100 QUSPTRUS( TmpUsrSpc1 : p_BD1 ); 30/08/08
55200 p_OutQ1 = p_BD1 + BD1.Offset1; 30/08/08
55300 18/07/08
55400 // Get a pointer to the start of the outq details 18/07/08
55500 QUSPTRUS( TmpUsrSpc2 : p_BD2 ); 30/08/08
55600 oqDtaPtr= p_BD2; 30/08/08
55700 endsr; 12/06/08
55800 12/06/08
55900 BegSr ListOutqs; // List all OutPut Queues to a user space 11/07/08
56000 // which we will treat as an array. 14/07/08
56100 QUSLOBJ( TmpUsrSpc1 12/06/08
56200 : ‘OBJL0100′ 12/06/08
56300 : OBJLIB 12/06/08
56400 : ‘*OUTQ’); 12/06/08
56500 12/06/08
56600 // Read thru the list of outqs and get the details on the Remote writers 11/07/08
56700 for Entry1 = 1 to BD1.Count1; 30/08/08
56800 p_OutQ1 = p_BD1 + (Entry1-1) * BD1.Size1 + BD1.Offset1; 30/08/08
56900 Exsr GetOutqDtls; 18/07/08
57000 endfor; 11/07/08
57100 endsr; 12/06/08
57200 11/07/08
57300 Begsr Add2Arr; // Save any previously selected records 14/07/08
57400 readc SFLrcd; 11/07/08
57500 dow not %eof; 11/07/08
57600 eval arropt(arrpos) = opt; 11/07/08
57700 eval arrO(arrpos) = objname; 31/08/08
57800 eval arrL(arrpos) = objslib; 31/08/08
57900 eval arrX(arrpos) = bmdsav; 31/08/08
58000 eval opt = ‘ ‘; 31/08/08
58100 // arrpos += 1; // v5r3 notation 2/09/08
58200 arrpos = arrpos + 1; 31/08/08
58300 readc SFLrcd; 11/07/08
58400 enddo; 11/07/08
58500 endsr; 11/07/08
58600 11/07/08
58700 Begsr Readarr; // Read all previously selected records 14/07/08
58800 ArrNbr = 1; 14/07/08
58900 Dou ArrNbr >= ArrPos; 15/07/08
59000 eval bmdX = ArrX(ArrNbr); 17/07/08
59100 OutQ2 = OutQdata(bmdx); 17/07/08
59200 31/08/08
59300 Select; 14/07/08
59400 18/07/08
59500 // Option-1 Start Remote Writer 18/07/08
59600 When ArrOpt(ArrNbr) = ‘1′; 14/07/08
59700 Cmd2Run = ‘StrRmtWtr outq(’ + 31/08/08
59800 %trim(OutQ2.OutQlib ) + ‘/’ + 31/08/08
59900 %trim(OutQ2.OutQname) + ‘)’; 31/08/08
60000 Exsr RunCmd; 14/07/08
5722SS1 V5R4M0 060210 COPY FILE WRKRMTWTR/WRKRMTWTRS WRKRMTWTRZ 12/01/12 15:01:11 Page 12

ok guys try these links and let me know if you can see the code ok?
http://pastebin.com/EXbXcCUy
http://pastebin.com/JZZXqZFd
http://pastebin.com/FqfuiuzQ
http://pastebin.com/wvKDjAwG
http://pastebin.com/7MuYBYuv


















