View previous topic :: View next topic |
Author |
Message |
AnilVogirala Beginner
Joined: 01 Apr 2004 Posts: 1 Topics: 1 Location: no
|
Posted: Thu Apr 01, 2004 7:35 am Post subject: Copy sequential file to PDS member |
|
|
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. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Thu Apr 01, 2004 8:18 am Post subject: |
|
|
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 _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
modak Beginner
Joined: 09 Apr 2004 Posts: 14 Topics: 3
|
Posted: Fri Apr 09, 2004 12:50 am Post subject: |
|
|
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. |
|
Back to top |
|
|
naveen Beginner
Joined: 03 Dec 2002 Posts: 90 Topics: 31
|
Posted: Fri Apr 09, 2004 1:56 am Post subject: |
|
|
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 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Fri Apr 09, 2004 3:28 am Post subject: |
|
|
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 _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
modak Beginner
Joined: 09 Apr 2004 Posts: 14 Topics: 3
|
Posted: Thu Apr 15, 2004 8:38 am Post subject: |
|
|
Thanks kolusu . Its working...onlY thing i am not able to get is ..what is 80:x in OUTREC |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12366 Topics: 75 Location: San Jose
|
Posted: Thu Apr 15, 2004 9:06 am Post subject: |
|
|
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 _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|