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 contents of dataset 2 which is within another dataset 1

 
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
stonecold
Beginner


Joined: 13 Feb 2006
Posts: 1
Topics: 1

PostPosted: Mon Feb 13, 2006 10:58 am    Post subject: Copy contents of dataset 2 which is within another dataset 1 Reply with quote

Hi ,

I have a dataset 1 ( Flat file , FB , 80 bytes) which contains another dataset 2 ( GDG version , FB , 80 bytes). The GDG contains some data in a single record.
I need to copy this content of the GDG to another dataset 3 .

How can this be done using FILEAID or IEBCOPY or some other IBM utilties.

I did some research to use IEBCOPY & FILEAID but it is difficult to go to the contents of second dataset. All i could do is access only the contents of dataset 1.

Please pass on your suggestions. Thanks in Advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Feb 13, 2006 11:50 am    Post subject: Reply with quote

stonecold,

Generate a JCL dynamically using Sort and submit to intrdr to actually copy the dataset.

Try this. Once you have verfied the generated JCL is correct, change the following statement

Code:

//SORTOUT   DD SYSOUT=*


to

Code:

//SORTOUT   DD SYSOUT=(*,INTRDR)



Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT    DD SYSOUT=*                                       
//SORTIN    DD *                                               
MY.GDG.VERSION FILE NAME                                       
//SORTOUT   DD SYSOUT=*                                       
//SYSIN     DD *                                               
 SORT FIELDS=COPY                                             
 OUTFIL OUTREC=(C'//USERIDZ  JOB ',X'7D',C'COPY',X'7D',C',',/,
                C'//',13X,C'CLASS=A,',/,                       
                C'//',13X,C'MSGCLASS=Y,',/,                   
                C'//',13X,C'MSGLEVEL=(1,1),',/,               
                C'//',13X,C'NOTIFY=USERID',/,                 
                C'//*',/,                                     
                C'//STEP0100 EXEC PGM=SORT',/,                 
                C'//SYSOUT   DD SYSOUT=*',/,                   
                C'//SORTIN   DD DISP=SHR,DSN=',1,44,/,         
                C'//SORTOUT  DD DSN=YOUR OUTPUT FILE,',/,     
                C'//            DISP=(NEW,CATLG,DELETE),',/,   
                C'//            UNIT=SYSDA,',/,               
                C'//            SPACE=(CYL,(X,Y),RLSE)',/,     
                C'//SYSIN    DD *',/,                         
                C'  SORT FIELDS=COPY',/,                       
                C'//*',80:X)                                   
/*                                                             


The generated JCL will be as follows

Code:

//USERIDZ  JOB 'COPY',                               
//             CLASS=A,                             
//             MSGCLASS=Y,                           
//             MSGLEVEL=(1,1),                       
//             NOTIFY=USERID                         
//*                                                 
//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DISP=SHR,DSN=MY.GDG.VERSION FILE NAME 
//SORTOUT  DD DSN=YOUR OUTPUT FILE,                 
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                           
//            SPACE=(CYL,(X,Y),RLSE)                 
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
//*                                                 


Make sure to change the userid to your t-id and code the proper space parameters.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
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