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 

Copy sequential file to PDS member

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
AnilVogirala
Beginner


Joined: 01 Apr 2004
Posts: 1
Topics: 1
Location: no

PostPosted: Thu Apr 01, 2004 7:35 am    Post subject: Copy sequential file to PDS member Reply with quote

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
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 01, 2004 8:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
modak
Beginner


Joined: 09 Apr 2004
Posts: 14
Topics: 3

PostPosted: Fri Apr 09, 2004 12:50 am    Post subject: Reply with quote

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


Joined: 03 Dec 2002
Posts: 90
Topics: 31

PostPosted: Fri Apr 09, 2004 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 09, 2004 3:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
modak
Beginner


Joined: 09 Apr 2004
Posts: 14
Topics: 3

PostPosted: Thu Apr 15, 2004 8:38 am    Post subject: Reply with quote

Thanks kolusu . Its working...onlY thing i am not able to get is ..what is 80:x in OUTREC
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 15, 2004 9:06 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) 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