| IBM MAINFRAME HELP & SUPPORT FORUMS Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
|
| View previous topic :: View next topic |
| Author |
Message |
niks_jude
Joined: 01 Dec 2006
Posts: 81
Location: Mumbai
|
| Posted: Thu Jul 31, 2008 9:27 am Post subject: Using ISREDIT to read the whole member into a stem variable |
|
|
Currently I am writing a utility to read the whole JCL member into a stem variable using the following-
Code: DROP PDFLT_LINE.
JCLIN = 'CNC20.TEST.JCL(TSTRUN)'
"ALLOC FI(INSKEL) DA('"||JCLIN||"') SHR"
"EXECIO * DISKR INSKEL (STEM PDFLT_LINE. FINIS"
"FREE FI(INSKEL)"
Can anybody tell me how I can do this by ISREDIT by typing the macro in my JCL member so that all the lines of JCL member get copied into stem variable? |
|
| Back to top |
|
expat
Joined: 14 Mar 2007
Posts: 3509
Location: Brussels once more ...
|
| Posted: Thu Jul 31, 2008 11:54 am Post subject: |
|
|
| And what do you want to do with the stem variables afterwards ? |
|
| Back to top |
|
dbzTHEdinosauer
Joined: 20 Oct 2006
Posts: 1618
Location: germany
|
| Posted: Thu Jul 31, 2008 12:19 pm Post subject: |
|
|
no answer from the OP.
niks_jude,
what do you want to do with the member contents?
Why put it into a stem variable (other than the fact you have already coded it - which obviously precludes any changes...)? |
|
| Back to top |
|
niks_jude
Joined: 01 Dec 2006
Posts: 81
Location: Mumbai
|
| Posted: Thu Jul 31, 2008 12:40 pm Post subject: |
|
|
This is my REXX. I read all the lines of JCL member - CNC20.TEST.JCL(TSTRUN) in the stem variable and do my operation on all the lines. What I want now is just type the macro in the JCL member in view mode and read it and do the operation. This will add flexibility and I do not have to modify the REXX for different datasets and/or members.
Code: PARSE SOURCE . . MYNAME . /* GET PROGRAM NAME */
EXIT_RC = 0 /* INITIALIZE RETURN CODE */
/*SIGNAL ON HALT */
/*SIGNAL ON SYNTAX */
GDSNOTFOUND = "DATASET NOT FOUND"
GMEMNOTFOUND = "MEMBER NOT FOUND"
CALL CONVERTPDF
EXIT
CONVERTPDF:
/* E = OUTTRAP ('OFF') */
X = SYSDSN("'CNC20.TEST.JCL(TSTRUN)'")
IF X = GMEMNOTFOUND THEN DO
SAY "MEMBER NOT FOUND"
RETURN
END
DROP PDFLT_LINE.
JCLIN = 'CNC20.TEST.JCL(TSTRUN)'
"ALLOC FI(INSKEL) DA('"||JCLIN||"') SHR"
"EXECIO * DISKR INSKEL (STEM PDFLT_LINE. FINIS"
"FREE FI(INSKEL)"
CALL QUEUEEDITCOMMANDS
RETURN
QUEUEEDITCOMMANDS:
DROP PDFOUT_LINE.
DO J = 1 TO PDFLT_LINE.0
DSNPOS = POS('DSN=',PDFLT_LINE.J)
IF DSNPOS /= 0 THEN DO
TEMP1 = SUBSTR(PDFLT_LINE.J,DSNPOS+4)
COMAPOS = POS(",",TEMP1)
IF COMAPOS /= 0 THEN DO
TEMP2 = SUBSTR(TEMP1,1,COMAPOS-1)
TEMP2 = "'"STRIP(TEMP2)"'"
SAY TEMP2 /* DEBUG */
X = LISTDSI(TEMP2 NORECALL)
SAY X /* DEBUG */
IF X = 0 THEN DO
COMEOUT = '0'
SAMELINE = J
J = J - 1
DO UNTIL COMEOUT = '1'
J = J + 1
DISPPOS = POS("DISP=(",PDFLT_LINE.J)
IF DISPPOS /= 0 THEN DO
TEMP3 = SUBSTR(PDFLT_LINE.J,DISPPOS+6,3)
COMEOUT = '1'
IF TEMP3 = 'NEW' THEN DO
SAY 'TEMP2'
END
END /* DISPOS IF END */
ELSE DO
IF J > SAMELINE THEN DO
DDPOS = POS(" DD ",PDFLT_LINE.J)
EXECPOS = POS(" EXEC ",PDFLT_LINE.J)
IF (DDPOS /= 0 | EXECPOS /=0) THEN DO
IF (DDPOS /= 0) THEN DO
J = J - 1
END /* SINGLE DDPOS IF END */
COMEOUT = '1'
END /*DDPOS AND EXECPOS IF END */
END /* SAMELINE CHECK END */
END /* DISPOS ELSE END */
END /* DO LOOP END */
END /* MEMBER NOT FOUND END */
END /* COMMA POS END */
END /* DSNPOS END */
END /* DO END */
RETURN |
|
| Back to top |
|
Pedro
Joined: 01 Sep 2006
Posts: 510
Location: work
|
| Posted: Thu Jul 31, 2008 9:54 pm Post subject: Reply to: Using ISREDIT to read the whole member into a stem |
|
|
See the ISPF Edit manual, here:
ISPF online manuals.
Read about the LINE macro command, as well as the .zfirst and .zlast labels. You can write a loop that gets one line at a time.
|
|
| Back to top |
|
niks_jude
Joined: 01 Dec 2006
Posts: 81
Location: Mumbai
|
| Posted: Fri Aug 01, 2008 6:26 pm Post subject: |
|
|
| I could not understand how to increase the line numbers? |
|
| Back to top |
|
Pedro
Joined: 01 Sep 2006
Posts: 510
Location: work
|
| Posted: Fri Aug 01, 2008 10:35 pm Post subject: Reply to: Using ISREDIT to read the whole member into a stem |
|
|
See the ISPF Edit manual, here:
ISPF online manuals.
Read about LOCATE and CURSOR
1. locate the last line
2. use cursor to get line number
3. use DO loop to process each line. |
|
| Back to top |
|
enrico-sorichetti
Joined: 14 Mar 2007
Posts: 3082
Location: italy
|
| Posted: Sun Aug 03, 2008 12:38 am Post subject: Reply to: Using ISREDIT to read the whole member into a stem |
|
|
what about something like...
Code: ISREDIT (first) = LINENUM .zfirst
ISREDIT (last) = LINENUM .zlast
i = 0
do linenum = first to last
i = i + 1
ISREDIT (temp) = LINE linenum
line.i = temp
end
line.0 = i
the stem line. will contain all the lines of the thing being edited
line.0 will hold the count |
|
| Back to top |
|
niks_jude
Joined: 01 Dec 2006
Posts: 81
Location: Mumbai
|
| Posted: Mon Aug 04, 2008 11:44 am Post subject: |
|
|
| It is what I was looking for thanks |
|
| Back to top |
|
| |
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
|