Copy sequential file to PDS member
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: Copy sequential file to PDS member Author: AnilVogiralaLocation: no PostPosted: Thu Apr 01, 2004 7:35 am
    —
Hello,

I want the JCL where I can copy a sequential file with length 133 characters to a member of a pds with length 80 characters. Please help me.

#2:  Author: kolusuLocation: San Jose PostPosted: Thu Apr 01, 2004 8:18 am
    —
AnilVogirala,

You can use iebgener, sort, file-aid to copy the seq dataset to a pds member
Code:

//STEP0100  EXEC  PGM=SORT                             
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD DSN=YOUR SEQ FILE,DISP=SHR               
//SORTOUT   DD DSN=YOUR PDS(MEMBER),DISP=SHR 
//SYSIN     DD *                                       
 SORT FIELDS=COPY                                     
 INREC FIELDS=(2,80)
/*


Hope this helps...

Cheers

Kolusu

#3:  Author: modak PostPosted: Fri Apr 09, 2004 12:50 am
    —
Dear Kolusu,
but it will truncate the records and only 80 chars will be copied in new member. What if we want that after copying 80 chars rest of the chars in 133 record should be listed in next line and shouldn't be truncated.

#4:  Author: naveen PostPosted: Fri Apr 09, 2004 1:56 am
    —
Here is an IEBGENER Example:

//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=YRTSOID.SEQ133.TESTFILE,DISP=SHR
//SYSUT2 DD DSN=YRTSOID.PDS80(NEWMEMNM),DISP=OLD
//SYSIN DD DUMMY

#5:  Author: kolusuLocation: San Jose PostPosted: Fri Apr 09, 2004 3:28 am
    —
Modak,

The following sort step will copy the first 80 bytes in one line and the rest of the chars in 133 record will be listed in next line

Code:

//STEP0100  EXEC  PGM=SORT                             
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD DSN=YOUR SEQ FILE,DISP=SHR               
//SORTOUT   DD DSN=YOUR PDS(MEMBER),DISP=SHR 
//SYSIN     DD *                                       
  SORT FIELDS=COPY                                     
  OUTFIL OUTREC=(1,80,/,
                81,53,80:X)
/*



Hope this helps...

Cheers

Kolusu

#6:  Author: modak PostPosted: Thu Apr 15, 2004 8:38 am
    —
Thanks kolusu . Its working...onlY thing i am not able to get is ..what is 80:x in OUTREC

#7:  Author: kolusuLocation: San Jose PostPosted: Thu Apr 15, 2004 9:06 am
    —
Modak,

Your input file is 133 bytes long and now we are splitting this record into 2 one with 80 bytes and the other with rest of 53 bytes.

Your PDS has an lrecl of 80 bytes. so each record is 80 bytes in length. when we split the record into 2 the second record is only 53 bytes. So I padded the rest of (80-53 = 27 bytes) with spaces.

80:X on the outrec will pad spaces to 80 bytes after the regular fields. i.e the second line has 53 bytes of data and rest 27 bytes will filled with spaces.If you remove the padding then the rest 27 bytes will have binary zeroes.you can also code the following control cards to achieve the same.

Code:

//SYSIN     DD *                                       
  SORT FIELDS=COPY                                     
  OUTFIL OUTREC=(1,80,/,
                81,53,
                27X)
/*


or

Code:

//SYSIN     DD *                                       
  SORT FIELDS=COPY                                     
  OUTFIL OUTREC=(1,80,/,
                81,53,
                27C' ')
/*


Hope this helps...

Cheers

Kolusu



MVSFORUMS.com -> Job Control Language(JCL)


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

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group