Skipping records from input file and writing into output fil
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: Skipping records from input file and writing into output fil Author: Srishti Rawat PostPosted: Sat Jun 03, 2023 9:04 am
    —
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.

#2:  Author: kolusuLocation: San Jose PostPosted: Sat Jun 03, 2023 5:15 pm
    —
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)     
/*

#3:  Author: Srishti Rawat PostPosted: Sun Jun 04, 2023 1:54 am
    —
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.

#4:  Author: misi01Location: Stockholm, Sweden PostPosted: Tue Jul 25, 2023 2:15 am
    —
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.



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group