MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Skipping records from input file and writing into output fil

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Srishti Rawat
Beginner


Joined: 03 Nov 2021
Posts: 20
Topics: 6

PostPosted: Sat Jun 03, 2023 9:04 am    Post subject: Skipping records from input file and writing into output fil Reply with quote

I am reading the output file which is a PDS member and writing the records into output pds member which we are creating in the REXX itself and doing some processing.
Here, I want to read the input file and skip the first three records of input file and add some hardcoded value in it. Please find below the ex for your reference:

/*input file
test record 1
test record 2
test record 3*/


/*output pds member
rec 1
rec 2
rec 3*/

Could you please help me out to achieve this.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sat Jun 03, 2023 5:15 pm    Post subject: Reply with quote

Srishti Rawat,

Why do you want to use REXX ? Even if you want to use, what is the problem you are having to create a new member with the desired information?

Assuming your PDS members have an LRECL of 80 and RECFM=FB, the following untested JCL will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DISP=SHR,DSN=Your.pds.name(memname)
//SORTOUT  DD DISP=SHR,DSN=Your.pds.name(newname)
//SYSIN    DD *   
  OPTION COPY,SKIPREC=3                         
  INREC BUILD=(06,03,
               12,69,
               80:X)     
/*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Srishti Rawat
Beginner


Joined: 03 Nov 2021
Posts: 20
Topics: 6

PostPosted: Sun Jun 04, 2023 1:54 am    Post subject: Reply with quote

Hi Kolusu,

With DFSORT its quite easy.

I am working on an automation in REXX where we are converting the PROD JCLs into TEST JCLs. So we are taking the existing prod jcl as input and creating a personal library creating a new member every time anyone wants to create a test jcl of prod version. I have replaced all the symbolic parameters but for JOB CARD I need to delete the prod job card and insert our test job card. For this I am trying to use ISREDIT in REXX which is not working. Also I tried to read records sequentially and than writing the records after 4th line into the output member but that is also not working properly for me.

Could you please help me out with the code to delete first three lines of a file and than insert hardcoded values and write rest of the records into output file.
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 618
Topics: 172
Location: Stockholm, Sweden

PostPosted: Tue Jul 25, 2023 2:15 am    Post subject: Reply with quote

If you're doing it in Rexx, in my mind, you can do it it one of 2 ways.
Either read in the whole PDS member via EXECIO and simply ignore the first 3 records, or .....
edit the file using whatever tool you want and run a Rexx script similar to this
Code:

Address ISPEXEC 'CONTROL ERRORS RETURN'  /* We handle any errors */ 
Address ISREDIT                                                     
                                                                     
'MACRO (PARMS) NOPROCESS'                                           
"locate 1"                                                           
"delete 1 3" 
/* Insert your new code lines here */                                                       

But this is so trivial, I'm guessing I'm missing something.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group