REXX program skips an input record



IBM's Command List programming language & Restructured Extended Executor

REXX program skips an input record

Postby collinsm » Tue Sep 20, 2022 12:30 am

I am running a REXX program within an Endevor processor. The REXX reads through a PDS member that contains JCL to execute a DB2 bind. The REXX reads each line of the JCL and makes modifications before queueing it. After it has read through all of the ddccards, it submits the job. The REXX is not reading a certain line of the JCL input.

These are lines 78, 79 and 80 in the input JCL.
000078 PKLIST( -
000079 DB2SUBR.BC20P007 +
000080 ) -
The REXX processes line 78 correctly. When it gets to the next line, it reads line 80 instead of 79. There is no place in the REXX loop that skips to the next record. Here are displays of the data, displaying the loop count and the input record:
77 RELEASE(COMMIT) -
B IS 77
CUR LINE IS RELEASE(COMMIT) -
78 PKLIST( -
B IS 78
CUR LINE IS PKLIST( -
79 ) -
B IS 79
CUR LINE IS ) -
80 EXPLAIN(N) -
B IS 80
CUR LINE IS EXPLAIN(N) -
collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby sergeyken » Tue Sep 20, 2022 2:45 am

Please, learn how to use the Code button when posting your samples.

Please, present your (likely incorrect) REXX code, besides of your own explanations “how it works”.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 427
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: REXX program skips an input record

Postby collinsm » Tue Sep 20, 2022 9:33 pm

collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby collinsm » Wed Sep 21, 2022 3:14 am

You do not have the required permissions to view the files attached to this post.
collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby sergeyken » Wed Sep 21, 2022 5:40 pm

Please, learn how to use the Code button when posting your samples.

Also: do not use attachments, or graphical screenshots.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 427
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: REXX program skips an input record

Postby collinsm » Wed Sep 21, 2022 8:23 pm

collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby collinsm » Wed Sep 21, 2022 8:24 pm

I used the code button, and I put my code between the two fields. When I hit the preview button it doesn't display my code. So where is it?
collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby collinsm » Wed Sep 21, 2022 8:50 pm

collinsm wrote:I used the code button, and I put my code between the two fields. When I hit the preview button it doesn't display my code. So where is it? I am now going to try and put the code between the quote fields.

collinsm wrote:/* REXX */ 00010000
/* ! 01 SET COMMAND VARIABLES */ 00020000
/*TRACE ?R */ 00030002
QUOTE = "'" 00040000
COMMA = "," 00050000
OPEN_BAN = '(' 00060000
CLOSE_BAN = ')' 00070000
EXCEPTION = 'NO' 00080000
PERCENT = '%' 00090000
BLANK = '' 00100000
D_SIGN = $ 00110000
WTO_INDEX = 0 00120000
WTO_INDEX1 = 0 00130000
NEW_PLAN = 'PLAN(DSNTIA12)' /* A12 MATCHS CURRENT DB2 VERSION */ 00140000
PLN_IDX_LNE = 'RUN PROGRAM'||OPEN_BAN||'DSNTIAD'||CLOSE_BAN 00150000
/* ! 02 READ PARMS FROM PROCESSOR */ 00160000
'EXECIO * DISKR PARMS (FINIS STEM PARM.' 00170000
DO P = 1 TO PARM.0 /* ! P LOOP */ 00180000
INTERPRET PARM.P 00190000
/* CHECK FOR $ IN CASE MEMBER NAME IS < 8 CHARACTERS */ 00200000
ELMNAME_DOLLAR_INDEX = 0 00210000
DOLLAR_FOUND = 'NO' 00220000
ELMNAME_DOLLAR_INDEX = INDEX(ELMNAME,'$') 00230000
IF ELMNAME_DOLLAR_INDEX > 0 THEN 00240000
DOLLAR_FOUND = 'YES' 00250000
END /* ! P LOOP */ 00260000
00270000
CALL INITAL_VARIABLE_SET /* ++ 01 */ 00280000
CALL CHECK_PROD_BIND_EXISTS /* ++ 02 */ 00290000
00300000
/* ! 03 READ EACH LINE OF PRODUCTION BIND CARD */ 00310000
IF USE_EXCEP_DSN = 'YES' THEN 00320000
DO /* ! EXECPT EXECIO */ 00330000
"ALLOC F(BINDEXMP) DA("IN_BIND_DSN") MOD REUSE" 00340000
'EXECIO * DISKR BINDEXMP (FINIS STEM CUR_LINE.' 00350000
EXCEPTION = 'YES' 00360000
END /* ! EXECPT EXECIO */ 00370000
IF USE_EXCEP_DSN ^= 'YES' THEN 00380000
DO /* ! MODEL EXECIO */ 00390000
"ALLOC F(BINDIN) DA("IN_BIND_DSN") MOD REUSE" 00400000
'EXECIO * DISKR BINDIN (FINIS STEM CUR_LINE.' 00410000
END /* ! MODEL EXECIO */ 00420000
DO B = 1 TO CUR_LINE.0 /* ! B LOOP */ 00430000
SAY B CUR_LINE.B 00440000
WTO_INDEX1 = INDEX(CUR_LINE.B,'//ST10 ') 00450000
IF WTO_INDEX1 > 0 THEN 00460000
CUR_LINE.B = '// ' 00470000
IF EXIT130_INDEX > 0 | , 00480000
EXIT035_INDEX > 0 THEN ITERATE 00490000
CALL LOOP_SET /* ++ 03 */ 00500000
QUEUE_LINE = CUR_LINE.B /* USE QUEUE_LINE AS OUTPUT */ 00510000
QUEUE_LINE_LENGTH = LENGTH(QUEUE_LINE) 00520000
00530000
/* ! 04 STOP AFTER WTO LOGIC */ 00540000
IF WTO_INDEX > 0 THEN ITERATE 00550000
WTO_INDEX = INDEX(CUR_LINE.B,'//ST10 ') 00560000
IF WTO_INDEX > 0 THEN 00570000
QUEUE_LINE = '// ' 00580000
00590000
/* ! 05 REMOVE COMMENT LINES */ 00600000
COMMENT_INDEX = INDEX(QUEUE_LINE,'//*') 00610000
IF COMMENT_INDEX = 1 THEN ITERATE 00620000
00630000
/* ! 06 PREVENTS DEV EMAIL FROM BEING SENT */ 00640000
EXIT130_INDEX = INDEX(QUEUE_LINE,'//ST130') 00650000
EXIT035_INDEX = INDEX(QUEUE_LINE,'//ST35') 00660000
IF EXIT130_INDEX > 0 | , 00670000
EXIT035_INDEX > 0 THEN ITERATE 00680000
00690000
/* ! 07 ONLY WHEN NO PROD BIND CARD */ 00700000
IF USE_MODEL_DSN = 'YES' | USE_EXCEP_DSN = 'YES' THEN 00710000
DO /* ! MODEL OR EXEPCTION */ 00720000
CALL MOD_ELM_NAME /* ++ 04 */ 00730000
CALL MOD_USER_NAME /* ++ 05 */ 00740000
END /* ! MODEL OR EXEPCTION */ 00750000
00760000
/* ! 08 FIND USER NAME IN JOBCARD */ 00770000
JOB_CARD_INDEX = INDEX(QUEUE_LINE,"//DSCCHQ01") 00780000
IF JOB_CARD_INDEX > 0 THEN 00790000
DO /* ! JOB CARD */ 00800000
PARSE VAR QUEUE_LINE 1 JOB_NAME 18 19 USER_NAME 26 . 00810000
USER_LENGTH = LENGTH(USER_NAME) 00820000
IF USER_NAME ^= ' ' THEN 00830000
USER_NAME_INDEX = INDEX(QUEUE_LINE,USER_NAME) 00840000
USER_DOT_INDEX = INDEX(USER_NAME,'.') 00850000
IF USER_DOT_INDEX > 0 THEN 00860000
DO /* ! USER NAME */ 00870000
PARSE VAR USER_NAME U1 "." U2 . 00880000
USER_NAME = U1 00890000
END /* ! USER NAME */ 00900000
NEW_JOB_NAME = '//SCTTHQBN' 00910000
QUEUE_LINE = OVERLAY(NEW_JOB_NAME,QUEUE_LINE,JOB_CARD_INDEX,10) 00920000
END /* ! JOB CARD */ 00930000
00940000
/* ! 09 CHANGE NOTIFY VALUE */ 00950000
NOTIFY_CARD_INDEX = INDEX(QUEUE_LINE,"NOTIFY=") 00960000
IF NOTIFY_CARD_INDEX > 0 THEN 00970000
IF NOTIFY_CARD_INDEX < 40 THEN /* DO ONLY REAL JOB CARD */ 00980000
DO /* ! NOTIFY */ 00990000
NOTIFY_USER_POS = NOTIFY_CARD_INDEX + 7 01000000
IF USER_LENGTH = ZEEUSER_LENGTH THEN 01010000
QUEUE_LINE = , 01020000
OVERLAY(ZEEUSER,QUEUE_LINE,NOTIFY_USER_POS,ZEEUSER_LENGTH) 01030000
IF USER_LENGTH ^= ZEEUSER_LENGTH THEN 01040000
CALL CHANGE_USER_LENGTH /* ++ 05A */ 01050000
END /* ! NOTIFY */ 01060000
/* ! 10 CHANGE XEQ VALUE */ 01070000
XEQ_CARD_INDEX = INDEX(QUEUE_LINE,"/*XEQ") 01080000
IF XEQ_CARD_INDEX = 1 THEN 01090000
DO /* ! XEQ CARD */ 01100000
QUEUE_LINE = "/*XEQ N4" /* BINDS ONLY RUN ON CPUT */ 01110000
IF PAYROLL = 'YES' THEN 01120000
QUEUE_LINE = "/*XEQ N2" /* PAYROLL BINDS ON CPUC */ 01130000
IF NDVRSTG = 'A' & WALK_SUB_SYSTEM = 'YES' THEN 01140000
QUEUE_LINE = "/*XEQ N1" /* WALKER STAGE A CPUE */ 01150000
END /* ! XEQ CARD */ 01160000
01170000
/* ! 11 CHANGE ROUTE PRINT VALUE */ 01180000
ROUTE_PRINT1_INDEX = INDEX(QUEUE_LINE,"/*ROUTE ") 01190000
ROUTE_PRINT2_INDEX = INDEX(QUEUE_LINE,"PRINT ") 01200000
IF ROUTE_PRINT1_INDEX > 0 & , 01210000
ROUTE_PRINT2_INDEX > 0 THEN 01220000
QUEUE_LINE = "/*ROUTE PRINT N4" 01230000
01240000
/* ! 12 CHANGE MSGCLASS */ 01250000
MSG_CLASS_INDEX = INDEX(QUEUE_LINE,"MSGCLASS=4") 01260000
IF MSG_CLASS_INDEX > 0 THEN 01270000
QUEUE_LINE = , 01280000
OVERLAY("MSGCLASS=P",QUEUE_LINE,MSG_CLASS_INDEX,10) 01290000
01300000
/* ! 13 CHANGE DB2 OWNER FROM PROD READY TO DEV READY */ 01310000
SQL_WORD1 = "SET CURRENT SQLID='DB2BINDR';" 01320000
DB2_SQL_OWNER_INDEX = INDEX(QUEUE_LINE,"DB2BINDR") 01330000
/* IF EXCEPTION = 'NO' THEN */ 01340000
IF DB2_SQL_OWNER_INDEX > 0 THEN 01350000
CALL CHANGE_SQL_OWNER /* ++ 06 */ 01360000
01370000
/* ! 14 CHANGE TO CURRENT USER */ 01380000
IF USER_NAME_INDEX > 0 THEN 01390000
CALL CHANGE_USER_NAME /* ++ 07 */ 01400000
01410000
/* ! 15 CHANGE DN2 TABLE */ 01420000
IF EXCEPTION = 'NO' THEN 01430000
CALL CHANGE_DB2_TABLE /* ++ 08 */ 01440000
01450000
/* ! 16 CHANGE THE STEPLIB VALUE */ 01460000
STEPLIB_INDEX = INDEX(QUEUE_LINE,'//STEPLIB') 01470000
IF STEPLIB_INDEX > 0 THEN 01480000
QUEUE_LINE = '//STEPLIB DD DSN=DB2OO.DB2EXIT,DISP=SHR ' 01490000
01500000
/* ! 17 BROUTINE LOGIC */ 01510000
PKLIST_INDEX = INDEX(QUEUE_LINE,'PKLIST(') 01520000
IF PKLIST_INDEX > 0 THEN PACK_LIST_ACTIVE = 'YES' 01530000
IF PACK_LIST_ACTIVE = 'YES' THEN 01540000
CALL PACK_LIST_LOGIC /* ++ 09 */ 01550000
01560000
/* ! 18 CHANGE THE DBRMLIB */ 01570000
DBRMLIB_INDEX = INDEX(QUEUE_LINE,'DBRMLIB') 01580000
DBRMSLAS_INDEX = INDEX(QUEUE_LINE,'//DBRMLIB') 01590000
IF DBRMLIB_INDEX > 0 THEN 01600000
IF DBRMSLAS_INDEX > 0 THEN 01610000
CALL CHANGE_DBRMLIB /* ++ 10 */ 01620000
01630000
/* ! 19 CHANGE THE PLAN TO VERSION 11 */ 01640000
PLAN_INDEX = INDEX(QUEUE_LINE,PLN_IDX_LNE) 01650000
IF PLAN_INDEX > 0 THEN 01660000
CALL CHANGE_PLAN /* ++ 10A */ 01670000
01680000
/* ! 20 CHANGE JOB HLQ DUE TO LACK OF TSS CR8 AUTHO */ 01690000
TT_CHGN_INDEX = INDEX(QUEUE_LINE,'TT.CHGCNTL') 01700000
HQ_CHGN_INDEX = INDEX(QUEUE_LINE,'HQ.CHGCNTL') 01710000
TT_BIND_INDEX = INDEX(QUEUE_LINE,'TT.BIND') 01720000
HQ_BIND_INDEX = INDEX(QUEUE_LINE,'HQ.BIND') 01730000
IF TT_CHGN_INDEX > 0 | TT_BIND_INDEX > 0 THEN 01740000
DO /* ! TT_ DSNS */ 01750000
IF ZEEUSER_LENGTH = 2 THEN 01760000
DO /* ! ZEE = 2 */ 01770000
B_DSN = ZEEUSER||'.TTTTTTT' 01780000
C_DSN = ZEEUSER||'.TTTTTTT' 01790000
END /* ! ZEE = 2 */ 01800000
IF ZEEUSER_LENGTH = 3 THEN 01810000
DO /* ! ZEE = 3 */ 01820000
C_DSN = ZEEUSER||'.TTTTTT' 01830000
B_DSN = ZEEUSER||'.TTTTTT' 01840000
END /* ! ZEE = 3 */ 01850000
IF ZEEUSER_LENGTH = 4 THEN 01860000
DO /* ! ZEE = 4 */ 01870000
C_DSN = ZEEUSER||'.TTTTT' 01880000
B_DSN = ZEEUSER||'.TTTTT' 01890000
END /* ! ZEE = 4 */ 01900000
IF ZEEUSER_LENGTH = 5 THEN 01910000
DO /* ! ZEE = 5 */ 01920000
C_DSN = ZEEUSER||'.TTTT' 01930000
B_DSN = ZEEUSER||'.TTTT' 01940000
END /* ! ZEE = 5 */ 01950000
IF ZEEUSER_LENGTH = 6 THEN 01960000
DO /* ! ZEE = 6 */ 01970000
C_DSN = ZEEUSER||'.TTT' 01980000
B_DSN = ZEEUSER||'.TTT' 01990000
END /* ! ZEE = 6 */ 02000000
IF ZEEUSER_LENGTH = 7 THEN 02010000
DO /* ! ZEE = 7 */ 02020000
C_DSN = ZEEUSER||'.TT' 02030000
B_DSN = ZEEUSER||'.TT' 02040000
END /* ! ZEE = 7 */ 02050000
IF ZEEUSER_LENGTH = 8 THEN 02060000
DO /* ! ZEE = 8 */ 02070000
C_DSN = ZEEUSER||'.T' 02080000
B_DSN = ZEEUSER||'.T' 02090000
END /* ! ZEE = 8 */ 02100000
C_DSN_LENGTH = LENGTH(C_DSN) 02110000
B_DSN_LENGTH = LENGTH(B_DSN) 02120000
END /* ! TT_ DSNS */ 02130000
02140000
/* QUEUE TT OR HQ DSN */ 02150000
IF TT_CHGN_INDEX > 0 THEN 02160000
QUEUE_LINE = OVERLAY(C_DSN,QUEUE_LINE,TT_CHGN_INDEX,C_DSN_LENGTH) 02170000
IF TT_BIND_INDEX > 0 THEN 02180000
QUEUE_LINE = OVERLAY(B_DSN,QUEUE_LINE,TT_BIND_INDEX,B_DSN_LENGTH) 02190000
IF HQ_CHGN_INDEX > 0 THEN 02200000
QUEUE_LINE = OVERLAY(ZEEUSER,QUEUE_LINE,HQ_CHGN_INDEX,ZEEUSER_LENGTH) 02210000
IF HQ_BIND_INDEX > 0 THEN 02220000
QUEUE_LINE = OVERLAY(ZEEUSER,QUEUE_LINE,HQ_BIND_INDEX,ZEEUSER_LENGTH) 02230000
02240000
/* ! 21 REMOVE DUPLICATE DBRMLIB LINES BEFORE QUEUE */ 02250000
IF DBRMLIB_INDEX ^> 0 THEN 02260000
QUEUE QUEUE_LINE 02270000
SAY 'B IS ' B 02271004
SAY 'CUR LINE IS ' CUR_LINE.B 02272004
END /* ! B LOOP */ 02280000
02290000
/* ! 22 WRITE THE OUTPUT AND SUBMIT BIND */ 02300000
BIND_DSN = QUOTE||OUTBIND'('ELMNAME')'||QUOTE 02310000
CALL NO_DUP_DSN /* ++ 11 */ 02320000
"ALLOC F(BINDOUT) DA("BIND_DSN") MOD REUSE" 02330000
'EXECIO' QUEUED() 'DISKW' BINDOUT '(FINIS' 02340000
"FREE F(BINDOUT)" 02350000
ADDRESS TSO SUB BIND_DSN 02360000
SAY BIND_DSN 'WAS SUBMITED FOR BIND' 02370000
EXIT 02380000
02390000
/* ! 23 START CALLED SUBROUTINES */ 02400000
INITAL_VARIABLE_SET: /* ++ 01 INITAL_VARIABLE_SET */ 02410000
USE_MODEL_DSN = 'NO' 02420000
USE_EXCEP_DSN = 'NO' 02430000
DBRM_LIB = DBRMDSN /* SET IN PROCESSOR */ 02440000
ZEEUSER_LENGTH = LENGTH(ZEEUSER) 02450000
ELM_LENGTH = LENGTH(ELMNAME) 02460000
ELM_NAME_HLQ = SUBSTR(ELMNAME,1,2) 02470000
ELM_SUB_SYS = SUBSTR(NDVRSUB,1,2) 02480000
CALL CHK_FOR_WALK_RCMS_SYSTEMS /* ++ 1A */ 02490000
DDCARD = ' ' 02500000
DSN_NAME = ' ' 02510000
JOB_NAME = ' ' 02520000
PK_L1 = ' ' 02530000
PK_L2 = ' ' 02540000
PK_L3 = ' ' 02550000
PK_L4 = ' ' 02560000
PK_L5 = ' ' 02570000
SLASH = ' ' 02580000
USER_NAME = ' ' 02590000
U1 = ' ' 02600000
U2 = ' ' 02610000
VAR1 = ' ' 02620000
VAR2 = ' ' 02630000
RETURN /* ++ 01 INITAL_VARIABLE_SET */ 02640000
02650000
/* ! 24 BIND CARD EXIST */ 02660000
CHECK_PROD_BIND_EXISTS: /* ++ 02 CHECK_PROD_BIND_EXISTS */ 02670000
SAY 'CHECK_PROD_BIND_EXISTS' 02680000
IN_DSN = QUOTE||"HQ.CHGCNTL.BIND("||ELMNAME||")"||QUOTE 02690000
BIND_CARD_EXIST = SYSDSN(IN_DSN) 02700000
EX_DSN = QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("||ELMNAME||")"||QUOTE 02710000
EXCEP_CARD_EXIST = SYSDSN(EX_DSN) 02720000
IF BIND_CARD_EXIST ^= 'OK' THEN 02730000
IF EXCEP_CARD_EXIST ^= 'OK' THEN 02740000
USE_MODEL_DSN = "YES" 02750000
IF EXCEP_CARD_EXIST = 'OK' THEN 02760000
DO /* ! EXECPTION YES */ 02770000
USE_EXCEP_DSN = "YES" 02780000
USE_MODEL_DSN = "NO" 02790000
END /* ! EXECPTION YES */ 02800000
/* */ 02810000
IF USE_MODEL_DSN = "YES" THEN 02820000
CALL SET_MODEL /* ++ 12 */ 02830000
IF USE_EXCEP_DSN = "YES" THEN 02840000
CALL SET_EXCEP /* ++ 13 */ 02850000
IF USE_MODEL_DSN ^= "YES" & USE_EXCEP_DSN ^= "YES" THEN 02860000
IN_BIND_DSN = , 02870000
QUOTE||"HQ.CHGCNTL.BIND("ELMNAME")"||QUOTE 02880000
RETURN /* ++ 02 CHECK_PROD_BIND_EXISTS */ 02890000
02900000
LOOP_SET: /* ++ 03 LOOP_SET */ 02910000
/* ! EACH LOOP RESET COUNTERS AND INDEX TO ZERO */ 02920000
BIND_CARD_EXIST = 'YES' 02930000
NOTIFY_CARD_INDEX = 0 02940000
NOTIFY_USER_POS = 0 02950000
COMMENT_INDEX = 0 02960000
DBRMLIB_INDEX = 0 02970000
DBRMSLAS_INDEX = 0 02980000
DB2_SQL_OWNER_INDEX = 0 02990000
DB2_SYS_INDEX = 0 03000000
END_PACK_LIST_INDEX = 0 03010000
EXIT035_INDEX = 0 03020000
EXIT130_INDEX = 0 03030000
HQ_BIND_INDEX = 0 03040000
HQ_CHGN_INDEX = 0 03050000
JOB_CARD_INDEX = 0 03060000
MOD_ELM_INDEX = 0 03070000
MOD_USER_INDEX = 0 03080000
PKLIST_INDEX = 0 03090000
ROUTE_PRINT1_INDEX = 0 03100000
ROUTE_PRINT2_INDEX = 0 03110000
SQL_WORD1_INDEX = 0 03120000
SQL_WORD2_INDEX = 0 03130000
STEPLIB_INDEX = 0 03140000
TT_BIND_INDEX = 0 03150000
TT_CHGN_INDEX = 0 03160000
USER_DOT_INDEX = 0 03170000
USER_NAME_INDEX = 0 03180000
VAR1_INDEX = 0 03190000
XEQ_CARD_INDEX = 0 03200000
RETURN /* ++ 03 LOOP_SET */ 03210000
03220000
MOD_ELM_NAME: /* ++ 04 MOD_ELM_NAME */ 03230000
MOD_ELM_INDEX = INDEX(QUEUE_LINE,'Z$$$$') 03240000
IF MOD_ELM_INDEX > 0 THEN 03250000
QUEUE_LINE = OVERLAY(ELMNAME,QUEUE_LINE,MOD_ELM_INDEX,ELM_LENGTH) 03260000
/* IF NO $ IN MEMBER NAME THEN CHANGE ALL $ TO BLANK. THIS IS ONLY 03270000
AN ISSUE WHEN NEW BIND CARD MEMBER NAME IS LT 8 CHARACTERS */ 03280000
IF DOLLAR_FOUND = 'NO' THEN 03290000
QUEUE_LINE = TRANSLATE(QUEUE_LINE,BLANK,D_SIGN) 03300000
RETURN /* ++ 04 MOD_ELM_NAME */ 03310000
03320000
MOD_USER_NAME: /* ++ 05 MOD_USER_NAME */ 03330000
MOD_USER_INDEX = INDEX(QUEUE_LINE,'%%%%%%%') 03340000
IF MOD_USER_INDEX > 0 THEN 03350000
DO /* ! MOD_USER_INDEX */ 03360000
QUEUE_LINE = OVERLAY(ZEEUSER,QUEUE_LINE,MOD_USER_INDEX,ZEEUSER_LENGTH) 03370000
QUEUE_LINE = TRANSLATE(QUEUE_LINE,PERCENT,BLANK) 03380000
END /* ! MOD_USER_INDEX */ 03390000
RETURN /* ++ 05 MOD_USER_NAME */ 03400000
03410000
CHANGE_SQL_OWNER: /* ++ 06 CHANGE_SQL_OWNER */ 03420000
SQL_WORD1 = "SET CURRENT SQLID='DB2BINDR';" 03430000
SQL_WORD2 = "OWNER(DB2BINDR)" 03440000
SQL_WORD1_INDEX = INDEX(QUEUE_LINE,SQL_WORD1) 03450000
SQL_WORD2_INDEX = INDEX(QUEUE_LINE,SQL_WORD2) 03460000
IF SQL_WORD1_INDEX > 0 THEN 03470000
DO /* ! CURRENT SQLID */ 03480000
IF NDVRSYS ^= HUMAN THEN 03490000
QUEUE_LINE = " SET CURRENT SQLID='DB2ISD';" 03500000
IF NDVRSYS = HUMAN THEN 03510000
QUEUE_LINE = " SET CURRENT SQLID='DB2PAYRL';" 03520000
IF RCMS_SYSTEM = 'YES' THEN 03530000
QUEUE_LINE = " SET CURRENT SQLID='DB2RCMS';" 03540000
END /* ! CURRENT SQLID */ 03550000
IF SQL_WORD2_INDEX > 0 THEN 03560000
DO /* ! OWNER ID */ 03570000
IF NDVRSYS ^= HUMAN THEN 03580000
QUEUE_LINE = " OWNER(DB2ISD) -" 03590000
IF NDVRSYS = HUMAN THEN 03600000
QUEUE_LINE = " OWNER(DB2PAYRL) -" 03610000
IF RCMS_SYSTEM = 'YES' THEN 03620000
QUEUE_LINE = " OWNER(DB2RCMS) -" 03630000
END /* ! OWNER ID */ 03640000
03650000
RETURN /* ++ 06 CHANGE_SQL_OWNER */ 03660000
CHANGE_USER_NAME: /* ++ 07 CHANGE_USER_NAME */ 03670000
IF ZEEUSER_LENGTH ^= USER_LENGTH THEN 03680000
CALL TRANS_USER_NAME /* ++ 14 */ 03690000
IF ZEEUSER_LENGTH = USER_LENGTH THEN 03700000
QUEUE_LINE = , 03710000
OVERLAY(ZEEUSER,QUEUE_LINE,USER_NAME_INDEX,USER_LENGTH) 03720000
RETURN /* ++ 07 CHANGE_USER_NAME */ 03730000
03740000
CHANGE_DB2_TABLE: /* ++ 08 CHANGE_DB2_TABLE */ 03750000
DB2_STATMENT = 'DSN SYSTEM'||OPEN_BAN /* ONLY USING OPEN_BAN */ 03760000
DB2_SYS_INDEX = INDEX(QUEUE_LINE,DB2_STATMENT) 03770000
IF DB2_SYS_INDEX > 0 THEN 03780000
DO /* ! DB2_SYS */ 03790000
QUEUE_LINE = 'DSN SYSTEM(DB2O)' 03800000
IF NDVRSTG = 'A' & WALK_SUB_SYSTEM = 'YES' THEN DO 03810000
QUEUE_LINE = 'DSN SYSTEM(DB2T)' 03820000
/* NEW_PLAN = 'PLAN(DSNTIA11)' */ 03830000
END 03840000
IF PAYROLL = 'YES' THEN DO /* SET IN THE PROCESSOR */ 03850000
QUEUE_LINE = 'DSN SYSTEM(DB2A)' 03860000
/* NEW_PLAN = 'PLAN(DSNTIA11)' */ 03870000
END 03880000
END /* ! DB2_SYS */ 03890000
RETURN /* ++ 08 CHANGE_DB2_TABLE */ 03900000
03910000
PACK_LIST_LOGIC: /* ++ 09 PACK_LIST_LOGIC */ 03920000
PACK_LIST_WORDS = WORDS(QUEUE_LINE) 03930000
IF PACK_LIST_WORDS > 1 THEN 03940000
PARSE VAR QUEUE_LINE PK_L1 PK_L2 PK_L3 PK_L4 PK_L5 . 03950000
IF PK_L1 = '+' | PK_L1 = '-' THEN PK_L1 = ' ' 03960000
IF PKLIST_INDEX > 0 THEN 03970000
IF PK_L1 ^= 'PKLIST(' THEN 03980000
DO /* ! PK_L1 */ 03990000
CALL DB2_PACK_PROCESS PK_L1 /* ++ 15 */ 04000000
PK_L1 = VAR1 04010000
END /* ! PK_L1 */ 04020000
IF PK_L2 = '+' | PK_L2 = '-' THEN PK_L2 = ' ' 04030000
IF PK_L2 ^= ' ' THEN 04040000
DO /* ! PK_L2 */ 04050000
CALL DB2_PACK_PROCESS PK_L2 /* ++ 15 */ 04060000
PK_L2 = VAR1 04070000
END /* ! PK_L2 */ 04080000
IF PK_L3 = '+' | PK_L3 = '-' THEN PK_L3 = ' ' 04090000
IF PK_L3 ^= ' ' THEN 04100000
DO /* ! PK_L3 */ 04110000
CALL DB2_PACK_PROCESS PK_L3 /* ++ 15 */ 04120000
PK_L3 = VAR1 04130000
END /* ! PK_L3 */ 04140000
IF PK_L4 = '+' | PK_L4 = '-' THEN PK_L4 = ' ' 04150000
IF PK_L4 ^= ' ' THEN 04160000
DO /* ! PK_L4 */ 04170000
CALL DB2_PACK_PROCESS PK_L4 /* ++ 15 */ 04180000
PK_L4 = VAR1 04190000
END /* ! PK_L4 */ 04200000
IF PK_L5 ^= ' ' THEN 04210000
DO /* ! PK_L5 ERROR CHECK */ 04220000
SAY 'PACKAGE LIST LARGER THEN EXPECTED' 04230000
SAY 'CONTACT BIND POC ' 04240000
END /* ! PK_L5 ERROR CHECK */ 04250000
END_PACK_LIST_INDEX = INDEX(QUEUE_LINE,CLOSE_BAN) 04260000
IF END_PACK_LIST_INDEX > 0 THEN 04270000
PACK_LIST_ACTIVE = 'OVER' 04280000
QUEUE_LINE_TEMP = ' ' 04290000
QUEUE_LINE_TEMP = PK_L1 PK_L2 PK_L3 PK_L4 PK_L5 04300000
RETURN /* ++ 09 PACK_LIST_LOGIC */ 04310000
04320000
DB2_PACK_PROCESS: /* ++ 15 DB2_PACK_PROCESS */ 04330000
ARG ARG_NAME 04340000
ARG_NAME_R = REVERSE(ARG_NAME) 04350000
PARSE VAR ARG_NAME_R VAR1 '.' VAR2 . 04360000
VAR1 = REVERSE(VAR1) 04370000
VAR1_INDEX = INDEX(ARG_NAME,VAR1) 04380000
VAR1_LENGTH = LENGTH(VAR1) 04390000
VAR1 = , 04400000
OVERLAY('*',ARG_NAME,VAR1_INDEX,VAR1_LENGTH) 04410000
RETURN /* ++ 15 DB2_PACK_PROCESS */ 04420000
04430000
CHANGE_DBRMLIB: /* ++ 10 CHANGE_DBRMLIB */ 04440000
PARSE VAR QUEUE_LINE SLASH DDCARD DSN_NAME . 04450000
QUEUE_LINE = SLASH DDCARD "DSN="||DBRM_LIB||",DISP=SHR" 04460000
/* ! DBRM_LINE = 'DONE' */ 04470000
DBRMLIB_INDEX = 0 04480000
RETURN /* ++ 10 CHANGE_DBRMLIB */ 04490000
CHANGE_PLAN: /* ++ 10A CHANGE_PLAN */ 04500000
PARSE VAR QUEUE_LINE RUN PGM OLD_PLAN . 04510000
QUEUE_LINE = RUN PGM NEW_PLAN 04520000
PLAN_INDEX = 0 04530000
RETURN /* ++ 10A CHANGE_DBRMLIB */ 04540000
04550000
NO_DUP_DSN: /* ++ 11 NO_DUP_DSN */ 04560000
MEM_EXIST = SYSDSN(BIND_DSN) 04570000
IF MEM_EXIST = 'OK' THEN 04580000
DO /* ! DELETE MEMBER */ 04590000
CALL OUTTRAP "LINE.", "*" 04600000
"DELETE" BIND_DSN 04610000
CALL OUTTRAP "OFF" 04620000
END /* ! DELETE MEMBER */ 04630000
RETURN /* ++ 11 NO_DUP_DSN */ 04640000
04650000
CHK_FOR_WALK_RCMS_SYSTEMS: /* ++ 1A CHK_FOR_WALK_RCMS_SYSTEMS */ 04660000
/* WALKER SET */ 04670000
WALK_SUB_SYSTEM = 'NO' 04680000
IF ELM_SUB_SYS = 'OA' | , 04690000
ELM_SUB_SYS = 'WI' | , 04700000
ELM_SUB_SYS = 'WK' THEN 04710000
WALK_SUB_SYSTEM = 'YES' 04720000
04730000
/* RCMS SET */ 04740000
RCMS_SYSTEM = 'NO' 04750000
IF ELM_SUB_SYS = 'RA' & , 04760000
ELM_NAME_HLQ = 'RA' THEN 04770000
RCMS_SYSTEM = 'YES' 04780000
RETURN /* ++ 1A CHK_FOR_WALK_RCMS_SYSTEMS */ 04790000
04800000
SET_MODEL: /* ++ 12 SET MODEL */ 04810000
MOD_NAME = '#MODEL' 04820000
HUM_NAME = '#HUMAN' 04830000
RCMS_NAME = '#RCMS' 04840000
WALK_NAME = '#WALK' 04850000
IN_BIND_DSN = , 04860000
QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("MOD_NAME")"||QUOTE 04870000
IF NDVRSYS = HUMAN THEN 04880000
IN_BIND_DSN = , 04890000
QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("HUM_NAME")"||QUOTE 04900000
IF RCMS_SYSTEM = 'YES' THEN 04910000
IN_BIND_DSN = , 04920000
QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("RCMS_NAME")"||QUOTE 04930000
IF WALK_SUB_SYSTEM = 'YES' THEN 04940000
IN_BIND_DSN = , 04950000
QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("WALK_NAME")"||QUOTE 04960000
SAY '**************************************************************' 04970000
SAY '*** BIND CARD FOR ' ELMNAME ' NOT FOUND IN HQ.CHGCNTL.BIND ***' 04980000
SAY '*** MODEL BIND CARD USED FOR GENERATE AND MOVE STEPS ONLY ***' 04990000
SAY '*** PRODUCTION BIND CARD IS NOT UPDATED. ***' 05000000
SAY '*** USE BIND DIALOG FOR PERMENENT CHANGES ***' 05010000
SAY '**************************************************************' 05020000
RETURN /* ++ 12 SET MODEL */ 05030000
05040000
SET_EXCEP: /* ++ 13 SET EXCEP */ 05050000
FILE_DISP = 'MOD' 05060000
IF BIND_CARD_EXIST ^= 'OK' THEN EXP_NAME = '#MODEL' 05070000
IF BIND_CARD_EXIST = 'OK' THEN EXP_NAME = ELMNAME 05080000
IN_BIND_DSN = , 05090000
QUOTE||"TT.AUTOBIND.CHGCNTL.EXEP("EXP_NAME")"||QUOTE 05100000
SAY '**************************************************************' 05110000
SAY '*** BIND CARD FOR ' ELMNAME ' EXCEPTION BIND CARD FOUND ***' 05120000
SAY '*** IN TT.AUTOBIND.CHGCNTL.EXEP ***' 05130000
SAY '*** BIND CARD USED FOR GENERATE AND MOVE PROCESS ONLY ***' 05140000
SAY '*** PRODUCTION BIND CARD IS NOT UPDATED. ***' 05150000
SAY '*** USE BIND DIALOG FOR PERMENENT CHANGES ***' 05160000
SAY '**************************************************************' 05170000
RETURN /* ++ 13 SET EXCEP */ 05180000
05190000
TRANS_USER_NAME: /* ++ 14 TRANS_USER_NAME */ 05200000
USER_POS = USER_NAME_INDEX 05210000
USER_POS_MINUS = USER_NAME_INDEX - 1 05220000
USER_END = USER_LENGTH + USER_NAME_INDEX 05230000
USER_LAST = USER_END - 1 05240000
PARSE VAR QUEUE_LINE , 05250000
1 USER1 USER_POS_MINUS , 05260000
USER_NAME_INDEX USER2 USER_END , 05270000
USER_LAST USER3 QUEUE_LINE_LENGTH . 05280000
RETURN /* ++ 14 TRANS_USER_NAME */ 05290000
CHANGE_USER_LENGTH: /* ++ 05A CHANGE_USER_LENGTH */ 05300000
PARSE VAR QUEUE_LINE NOTIFY_PARM ',' MSG_PARM ',' REGION_PARM . 05310000
NEW_NOTIFY_PARM = 'NOTIFY='||ZEEUSER 05320000
QUEUE_LINE = , 05330000
'// ' NEW_NOTIFY_PARM||COMMA||MSG_PARM||COMMA||REGION_PARM 05340000
RETURN /* ++ 05A CHANGE_USER_LENGTH */ 05350000
collinsm
 
Posts: 13
Joined: Mon Sep 19, 2022 9:19 pm
Has thanked: 7 times
Been thanked: 0 time

Re: REXX program skips an input record

Postby sergeyken » Wed Sep 21, 2022 9:06 pm

collinsm wrote:I used the code button, and I put my code between the two fields. When I hit the preview button it doesn't display my code. So where is it?


Looks like the forum limits the total amount of code shown in one single window.

PLEASE!!!! Do not include 100500 lines of your code, but instead focus on its critical parts, with suspicious behavior. People do not plan to dive into such a mess. Especially - there is no need to bring here line numbers, etc etc...

Try to be polite to people who potentially might help you, but you frighten them away with your way of presenting your problem...

The Code button works fine; with a reasonable amount of code it shows what is expected:

/* REXX */ 00010000
/* ! 01 SET COMMAND VARIABLES */ 00020000
/*TRACE ?R */ 00030002
QUOTE = "'" 00040000
COMMA = "," 00050000
OPEN_BAN = '(' 00060000
CLOSE_BAN = ')' 00070000
EXCEPTION = 'NO' 00080000
PERCENT = '%' 00090000
BLANK = '' 00100000
D_SIGN = $ 00110000
WTO_INDEX = 0 00120000
WTO_INDEX1 = 0 00130000
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 427
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: REXX program skips an input record

Postby sergeyken » Wed Sep 21, 2022 9:19 pm

Before working on this terrible processing of your data, prepare the simplest example: only read your data, line by line, and display the line counter, and line content. Remove all other garbage, which you are no able to manage!!!

After you are sure your input lines are being read correctly, you can start adding your terrible processing of each input line, but again: step by step, not all together!!!

I'm not going to dive into your mess; preliminary I suspect that your stem index named with "fine looking" identifier B may be accidentally changed among all other mess.

This is full your responsibility - to verify the logical flow of execution within such a terrible mess. I give up to trace it for you.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 427
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post