Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using ISREDIT to read the whole member into a stem variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Jul 31, 2008 9:27 am    Post subject: Using ISREDIT to read the whole member into a stem variable
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jul 31, 2008 11:54 am    Post subject:
Reply with quote

And what do you want to do with the stem variables afterwards ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jul 31, 2008 12:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Jul 31, 2008 12:40 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2050
Location: Silicon Valley

PostPosted: Thu Jul 31, 2008 9:54 pm    Post subject: Reply to: Using ISREDIT to read the whole member into a stem
Reply with quote

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
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Fri Aug 01, 2008 6:26 pm    Post subject:
Reply with quote

I could not understand how to increase the line numbers?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2050
Location: Silicon Valley

PostPosted: Fri Aug 01, 2008 10:35 pm    Post subject: Reply to: Using ISREDIT to read the whole member into a stem
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Sun Aug 03, 2008 12:38 am    Post subject: Reply to: Using ISREDIT to read the whole member into a stem
Reply with quote

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
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Aug 04, 2008 11:44 am    Post subject:
Reply with quote

It is what I was looking for thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us