Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

edit dataset not working

Status
Not open for further replies.
Nov 23, 2004
7
US
I am running a batchtso that's not working. The PARSE is not returning anything and I have to cancel job to end. Anything will be appreciated. The end result should be:

CHANGE.SUBSYS SSID(#910973 ) STARTRCV
CHANGE.SUBSYS SSID(#910973 ) ENDRECOV
CHANGE.SUBSYS SSID(#981424 ) STARTRCV
CHANGE.SUBSYS SSID(#981424 ) ENDRECOV

ctllib:
PROFILE PREFIX(#999336)
ISPSTART BDISPMAX(999999) CMD(%OLICDJEA)

CMD(%OLICDJEA):
PROC 0
COPY LSTSBSYS.SYSPRINT LSTSBSYS.SYSUT2
ISPEXEC EDIT DATASET(LSTSBSYS.SYSUT2) MACRO(OLICDJAE)

MACRO(OLICDJAE):

/* REXX */
TRACE I
ADDRESS ISREDIT
"EX ALL"
"F ALL 'LOG START=00.000 00:00:00.0'"
FINDRC = RC
IF FINDRC = 0 THEN ,
DO
SAY ' NO ORPHANED JOBS '
ZISPFRC = 20
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE "
"END"
EXIT 20
END
ELSE,
"(NUMSSIDS) = FIND_COUNTS"
"DEL X ALL"
LINECNT = 0
/* DO NUMSSIDS */
"F FIRST 'SSID='"
"(LINDATA) = LINE .ZCSR"
PARSE VAR LINDATA 'SSID=' SSID LOG START=00.000 00:00:00.0' TRASH
/* PARSE VAR LINDATA PART1 8 SSID PART2 15 PART3 . */
/* PARSE VAR LINDATA PART1 9 SSID . */
LINECNT = LINECNT + 1
NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") STARTRCV"
LINECNT = LINECNT + 1
NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
"DEL NX .ZCSR .ZCSR"
/* END */
NEWLINE.0 = LINECNT
DO I = 1 TO NEWLINE.0
SSIDLINE = NEWLINE.I
"LINE_AFTER &I = DATALINE '&SSIDLINE'"
/* END */
ZISPFRC = 0
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE"
"END"
RETURN


LSTSBSYS.SYSUT2:

SSYS
SSID=#910973 LOG START=00.000 00:00:00.0
SSTYPE=BATCH ABNORMAL TERM=OFF RECOVERY STARTED=NO BACKUP=NO
TRACKED=NO TRACKER TERM=OFF SHARING COVERED DBS=NO
IRLMID=I0LM. IRLM STATUS=NORMAL GSGNAME=**NULL**

AUTHORIZED DATA BASES/AREAS=3 VERSION=6.1
ENCODED
-DBD- -AREA- -LEVEL- -ACCESS INTENT- -STATE-
FACPIA02 **NULL** 1 READ-GO 1
FACPDA02 **NULL** 1 READ-GO 1
FACPDA01 **NULL** 1 READ-GO 1

SSYS
SSID=#981424 LOG START=00.000 00:00:00.0
SSTYPE=BATCH ABNORMAL TERM=OFF RECOVERY STARTED=NO BACKUP=NO
TRACKED=NO TRACKER TERM=OFF SHARING COVERED DBS=NO
IRLMID=I0LM. IRLM STATUS=NORMAL GSGNAME=**NULL**

AUTHORIZED DATA BASES/AREAS=2 VERSION=6.1
ENCODED
-DBD- -AREA- -LEVEL- -ACCESS INTENT- -STATE-
PIDPIA04 **NULL** 2 READ-GO 1
PIDPDA04 **NULL** 2 READ-GO 1

SSYS,
SSID=#981591I LOG START=04.289 15:55:41.8
SSTYPE=BATCH ABNORMAL TERM=ON RECOVERY STARTED=NO BACKUP=NO
TRACKED=NO TRACKER TERM=OFF SHARING COVERED DBS=NO
IRLMID=**NULL** IRLM STATUS=NORMAL GSGNAME=**NULL**

AUTHORIZED DATA BASES/AREAS=0 VERSION=6.1

SSYS
SSID=#981591J LOG START=04.290 09:54:28.3
SSTYPE=BATCH ABNORMAL TERM=ON RECOVERY STARTED=NO BACKUP=NO
TRACKED=NO TRACKER TERM=OFF SHARING COVERED DBS=NO
IRLMID=**NULL** IRLM STATUS=NORMAL GSGNAME=**NULL**
 
I think I found the answer to my own question from one of your other threads!!! I place "MACRO" right after the ADDRESS ISREDIT and was able to edit the dataset. The results are not what I expected but I can work with that.

results:

SSID=#999149 LOG START=00.000 00:00:00.0
HANGE.SUBSYS SSID=(#981424 ) STARTRCV

I might be back for some help if I can't get this one figured out. Thanks for this FORUM!!!
 
This seems to be working well except now it's in a looping and I have to cancel the job:
READY
PROFILE PREFIX(#999336)
READY
ISPSTART BDISPMAX(999999) CMD(%OLICDJEA)
3 *-* ADDRESS ISREDIT
4 *-* "MACRO"
>L> "MACRO"
5 *-* "EX ALL"
>L> "EX ALL"
6 *-* "F ALL 'LOG START=00.000 00:00:00.0'"
>L> "F ALL 'LOG START=00.000 00:00:00.0'"
7 *-* FINDRC = RC
>V> "0"
8 *-* IF FINDRC < 0
>V> "0"
>L> "0"
>O> "0"

17 *-* ELSE,
18 *-* "(NUMSSIDS) = FIND_COUNTS"
>L> "(NUMSSIDS) = FIND_COUNTS"
19 *-* "DEL X ALL"
>L> "DEL X ALL"
20 *-* LINECNT = 0
>L> "0"
21 *-* DO NUMSSIDS
>V> "00000002"
22 *-* "F FIRST 'SSID='"
>L> "F FIRST 'SSID='"
23 *-* "(LINDATA) = LINE .ZCSR"
>L> "(LINDATA) = LINE .ZCSR"
24 *-* PARSE VAR LINDATA 'SSID=' SSID 'LOG START=00.000 00:00:00.0' TRASH
>>> "#981424 "
>>> "
25 *-* /**/
26 *-* /**/
27 *-* LINECNT = LINECNT + 1
>V> "0"
>L> "1"
>O> "1"
28 *-* NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") STARTRCV"
>L> "CHANGE.SUBSYS SSID=("
>V> "#981424 "
>O> "CHANGE.SUBSYS SSID=(#981424 "
>L> ") STARTRCV"
>O> "CHANGE.SUBSYS SSID=(#981424 ) STARTRCV"
>C> "NEWLINE.1"
29 *-* LINECNT = LINECNT + 1
>V> "1"
>L> "1"
>O> "2"
30 *-* NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
>L> "CHANGE.SUBSYS SSID=("
>V> "#981424 "
>O> "CHANGE.SUBSYS SSID=(#981424 "
>L> ") ENDRECOV"
>O> "CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV"
>C> "NEWLINE.2"
31 *-* "DEL NX .ZCSR .ZCSR"
>L> "DEL NX .ZCSR .ZCSR"
32 *-* END
21 *-* DO NUMSSIDS
22 *-* "F FIRST 'SSID='"
>L> "F FIRST 'SSID='"
23 *-* "(LINDATA) = LINE .ZCSR"
>L> "(LINDATA) = LINE .ZCSR"
24 *-* PARSE VAR LINDATA 'SSID=' SSID 'LOG START=00.000 00:00:00.0' TRASH
>>> "#999149 "
>>> "
25 *-* /**/
26 *-* /**/
27 *-* LINECNT = LINECNT + 1
>V> "2"
>L> "1"
>O> "3"
28 *-* NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") STARTRCV"
>L> "CHANGE.SUBSYS SSID=("
>V> "#999149 "
>O> "CHANGE.SUBSYS SSID=(#999149 "
>L> ") STARTRCV"
>O> "CHANGE.SUBSYS SSID=(#999149 ) STARTRCV"
>C> "NEWLINE.3"
29 *-* LINECNT = LINECNT + 1
>V> "3"
>L> "1"
>O> "4"
30 *-* NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
>L> "CHANGE.SUBSYS SSID=("
>V> "#999149 "
>O> "CHANGE.SUBSYS SSID=(#999149 "
>L> ") ENDRECOV"
>O> "CHANGE.SUBSYS SSID=(#999149 ) ENDRECOV"
>C> "NEWLINE.4"
31 *-* "DEL NX .ZCSR .ZCSR"
>L> "DEL NX .ZCSR .ZCSR"
32 *-* END
21 *-* DO NUMSSIDS
33 *-* NEWLINE.0 = LINECNT
>V> "4"
34 *-* DO I = 1 TO NEWLINE.0
>L> "1"
>V> "4"
35 *-* SSIDLINE = NEWLINE.I
>C> "NEWLINE.1"
>V> "CHANGE.SUBSYS SSID=(#981424 ) STARTRCV"
36 *-* "LINE_AFTER &I = DATALINE '&SSIDLINE'"
>L> "LINE_AFTER &I = DATALINE '&SSIDLINE'"
+++ RC(28) +++
37 *-* END
34 *-* DO I = 1 TO NEWLINE.0
35 *-* SSIDLINE = NEWLINE.I
>C> "NEWLINE.2"
>V> "CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV"
36 *-* "LINE_AFTER &I = DATALINE '&SSIDLINE'"
>L> "LINE_AFTER &I = DATALINE '&SSIDLINE'"
+++ RC(28) +++
37 *-* END
34 *-* DO I = 1 TO NEWLINE.0
35 *-* SSIDLINE = NEWLINE.I
>C> "NEWLINE.3"
>V> "CHANGE.SUBSYS SSID=(#999149 ) STARTRCV"
36 *-* "LINE_AFTER &I = DATALINE '&SSIDLINE'"
>L> "LINE_AFTER &I = DATALINE '&SSIDLINE'"
+++ RC(28) +++
37 *-* END
34 *-* DO I = 1 TO NEWLINE.0
35 *-* SSIDLINE = NEWLINE.I
>C> "NEWLINE.4"
>V> "CHANGE.SUBSYS SSID=(#999149 ) ENDRECOV"
36 *-* "LINE_AFTER &I = DATALINE '&SSIDLINE'"
>L> "LINE_AFTER &I = DATALINE '&SSIDLINE'"
+++ RC(28) +++
37 *-* END
34 *-* DO I = 1 TO NEWLINE.0
38 *-* ZISPFRC = 0
>L> "0"
39 *-* ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
>L> "VPUT ZISPFRC SHARED"
40 *-* "SAVE"
>L> "SAVE"
+++ RC(28) +++
41 *-* "END"
>L> "END"
+++ RC(28) +++
42 *-* RETURN










/* REXX */
TRACE I
ADDRESS ISREDIT
"MACRO"
"EX ALL"
"F ALL 'LOG START=00.000 00:00:00.0'"
FINDRC = RC
IF FINDRC < 0 THEN ,
DO
SAY ' NO ORPHANED JOBS '
ZISPFRC = 20
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE "
"END"
EXIT 20
END
ELSE,
"(NUMSSIDS) = FIND_COUNTS"
"DEL X ALL"
LINECNT = 0
DO NUMSSIDS
"F FIRST 'SSID='"
"(LINDATA) = LINE .ZCSR"
PARSE VAR LINDATA 'SSID=' SSID 'LOG START=00.000 00:00:00.0' TRASH
/* PARSE VAR LINDATA PART1 8 SSID PART2 15 PART3 . */
/* PARSE VAR LINDATA PART1 9 SSID . */
LINECNT = LINECNT + 1
NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") STARTRCV"
LINECNT = LINECNT + 1
NEWLINE.LINECNT = "CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
"DEL NX .ZCSR .ZCSR"
END
NEWLINE.0 = LINECNT
DO I = 1 TO NEWLINE.0
SSIDLINE = NEWLINE.I
"LINE_AFTER &I = DATALINE '&SSIDLINE'"
END
ZISPFRC = 0
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE"
"END"
RETURN


 
First, TRACE I is probably giving you more information than you can use and making the trace harder to read; TRACE R is usually adequate.

Second, if SSIDLINE is ready to be used as-is, put it in parentheses rather than quotes (and lose the ampersand):
Code:
"LINE_AFTER" i "= DATALINE" (ssidline)

Third, I would love to see the value of ZERRLM after one of those '28's

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks but I still am getting the same results...
Sorry but you are talikng to a real novice here. Just started learning REXX and not sure what or how to give you the ZERRLM results...
 
Got it...

Exit routine at 8779F508 gave error code 20 for FIND of ),ENDREC

hopes this makes sense to you.

thanks
 
I have resolved the RC=28 by using
"LINE_AFTER" I "= '&SSIDLINE'"
Now my output contains duplicates. I think it may because of the "end" parameter.
Could someone help me with this one?

/* REXX */
TRACE I
ADDRESS ISREDIT
"MACRO"
"EX ALL"
"F ALL 'LOG START=00.000 00:00:00.0'"
FINDRC = RC
IF FINDRC < 0 THEN ,
DO
SAY ' NO ORPHANED JOBS '
ZISPFRC = 20
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE "
"END"
EXIT 20
END
ELSE,
"(NUMSSIDS) = FIND_COUNTS"
"DEL X ALL"
LINECNT = 0
DO NUMSSIDS
"F FIRST 'SSID='"
"(LINDATA) = LINE .ZCSR"
PARSE VAR LINDATA PART1 9 SSID
IF SUBSTR(LINDATA,19) = 'LOG START=00.000 00:00:00.0' THEN
DO
SSID = SUBSTR(LINDATA,09,8)
END
LINECNT = LINECNT + 1
NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") STARTRCV"
LINECNT = LINECNT + 1

NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
"DEL NX .ZCSR .ZCSR"
NEWLINE.0 = LINECNT
DO I = 1 TO NEWLINE.0
SSIDLINE = NEWLINE.I
"LINE_AFTER" I "= '&SSIDLINE'"
END
END
ZISPFRC = 0
ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
"SAVE"
"END"
RETURN


TRACE RESULTS:

READY
PROFILE PREFIX(#999336)
READY
ISPSTART BDISPMAX(999999) CMD(%OLICDJEA)
3 *-* ADDRESS ISREDIT
4 *-* "MACRO"
>>> "MACRO"
5 *-* "EX ALL"
>>> "EX ALL"
6 *-* "F ALL 'LOG START=00.000 00:00:00.0'"
>>> "F ALL 'LOG START=00.000 00:00:00.0'"
7 *-* FINDRC = RC
>>> "0"
8 *-* IF FINDRC < 0
>>> "0"
17 *-* ELSE,
18 *-* "(NUMSSIDS) = FIND_COUNTS"
>>> "(NUMSSIDS) = FIND_COUNTS"
19 *-* "DEL X ALL"
>>> "DEL X ALL"
20 *-* LINECNT = 0
>>> "0"
21 *-* DO NUMSSIDS
>>> "00000002"
22 *-* "F FIRST 'SSID='"
>>> "F FIRST 'SSID='"
23 *-* "(LINDATA) = LINE .ZCSR"
>>> "(LINDATA) = LINE .ZCSR"
24 *-* PARSE VAR LINDATA PART1 9 SSID
>>> " SSID="
>>> "#981424 LOG START=00.000 00:00:00.0
"
25 *-* IF SUBSTR(LINDATA,19) = 'LOG START=00.000 00:00:00.0'
>>> "1"
*-* THEN
26 *-* DO
27 *-* SSID = SUBSTR(LINDATA,09,8)
>>> "#981424 "
28 *-* END
29 *-* LINECNT = LINECNT + 1
>>> "1"
30 *-* NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") STARTRCV"
>>> " CHANGE.SUBSYS SSID=(#981424 ) STARTRCV"
31 *-* LINECNT = LINECNT + 1
>>> "2"
32 *-* NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
>>> " CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV"
33 *-* "DEL NX .ZCSR .ZCSR"
>>> "DEL NX .ZCSR .ZCSR"
34 *-* NEWLINE.0 = LINECNT
>>> "2"
35 *-* DO I = 1 TO NEWLINE.0
>>> "1"
>>> "2"
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#981424 ) STARTRCV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 1 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 2 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
39 *-* END
21 *-* DO NUMSSIDS
22 *-* "F FIRST 'SSID='"
>>> "F FIRST 'SSID='"
23 *-* "(LINDATA) = LINE .ZCSR"
>>> "(LINDATA) = LINE .ZCSR"
24 *-* PARSE VAR LINDATA PART1 9 SSID
>>> " SSID="
>>> "#999149 LOG START=00.000 00:00:00.0
"
25 *-* IF SUBSTR(LINDATA,19) = 'LOG START=00.000 00:00:00.0'
>>> "1"
*-* THEN
26 *-* DO
27 *-* SSID = SUBSTR(LINDATA,09,8)
>>> "#999149 "
28 *-* END
29 *-* LINECNT = LINECNT + 1
>>> "3"
30 *-* NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") STARTRCV"
>>> " CHANGE.SUBSYS SSID=(#999149 ) STARTRCV"
31 *-* LINECNT = LINECNT + 1
>>> "4"
32 *-* NEWLINE.LINECNT = " CHANGE.SUBSYS SSID=("SSID") ENDRECOV"
>>> " CHANGE.SUBSYS SSID=(#999149 ) ENDRECOV"
33 *-* "DEL NX .ZCSR .ZCSR"
>>> "DEL NX .ZCSR .ZCSR"
34 *-* NEWLINE.0 = LINECNT
>>> "4"
35 *-* DO I = 1 TO NEWLINE.0
>>> "1"
>>> "4"
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#981424 ) STARTRCV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 1 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 2 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#999149 ) STARTRCV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 3 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
36 *-* SSIDLINE = NEWLINE.I
>>> " CHANGE.SUBSYS SSID=(#999149 ) ENDRECOV"
37 *-* "LINE_AFTER" I "= '&SSIDLINE'"
>>> "LINE_AFTER 4 = '&SSIDLINE'"
38 *-* END
35 *-* DO I = 1 TO NEWLINE.0
39 *-* END
21 *-* DO NUMSSIDS
40 *-* ZISPFRC = 0
>>> "0"
41 *-* ADDRESS ISPEXEC "VPUT ZISPFRC SHARED"
>>> "VPUT ZISPFRC SHARED"
42 *-* "SAVE"
>>> "SAVE"
43 *-* "END"
>>> "END"
44 *-* RETURN


Edit results:

CHANGE.SUBSYS SSID=(#981424 ) STARTRCV
CHANGE.SUBSYS SSID=(#981424 ) STARTRCV
CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV
CHANGE.SUBSYS SSID=(#999149 ) STARTRCV
CHANGE.SUBSYS SSID=(#999149 ) ENDRECOV
CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV

If I remove the "end" parameter prior to "ZISPFRC = 0"
The results are:

SSID=#999149 LOG START=00.000 00:00:00.0
CHANGE.SUBSYS SSID=(#981424 ) STARTRCV
CHANGE.SUBSYS SSID=(#981424 ) ENDRECOV

thanks again for your help,

Judy














 
Judy, package your source as a .txt attachment and send it to me at

frank dot clarke at nielsenmedia dot com



Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
thanks so much for everyones input. Frank thanks again for helping me resolve this issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top