View previous topic :: View next topic
|
Author |
Message |
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
And what do you want to do with the stem variables afterwards ? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
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
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
Back to top |
|
|
niks_jude Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
I could not understand how to increase the line numbers? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 Warnings : 1 Active User
Joined: 01 Dec 2006 Posts: 144 Location: Mumbai
|
|
|
|
It is what I was looking for thanks |
|
Back to top |
|
|
|