IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy multiple sequential data sets into one PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Apr 18, 2012 1:08 am
Reply with quote

On November 9,2011 gylbharat posted a problem whereby he was trying to copy 100 sequential data set into a partitioned data set with the partitioned data set having 100 members. I have the same problem but I have only two sequential data sets. He used IEBGENER and apparently was successful in achieving his objective. I want to name my two members MYSASLOG and MYSASLST. Here is the JCL I believe would work but I am unsure of how to specify the names in the JCL.

Code:
//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD DSN=RMTPRD.EES.S688CLW.SASDLIB.LOG,
//     DISP=(OLD,KEEP),UNIT=SYSPRD
//       DD DSN=RMTPRD.EES.S688CLW.SASDLIB.LST,
//     DISP=(OLD,KEEP),UNIT=SYSPRD
//SYSUT2 DD DSN=S688CLW.SASWORK.SASOUT,DISP=(NEW,CATLG,DELETE),
//     UNIT=SYSPRD,SPACE=(TRK,(50,10,5)),
//     DCB=(DSORG=PO,RECFM=FB,LRECL=256,BLKSIZE=12800)
//SYSIN DD *
GENERATE MAXNAME=2
MEMBER NAME=MYSASLOG MYSASLST
/*
//SYSPRINT DD SYSOUT=A
//SYDUMP  DD SYSOUT=A
//

Charles Wolters (AKA CW)
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 18, 2012 1:32 am
Reply with quote

Hello,

You cannot concatenate the input files as you have done.

Following the jcl you have, suggest you split this into 2 steps and copy one file to a member in each.

Processing one file per step will allow removing the SYSIN statements and using a //SYSIN DD DUMMY
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Apr 18, 2012 1:47 am
Reply with quote

Thanks Dick. I will do that. To satisfy my curiosity, did gylbharat ( Nov 9, 2011 post) with his 100 sequential data sets then have to construct 100 steps in his JCL?

Charles
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 18, 2012 2:00 am
Reply with quote

As a proof-of-concept, I whipped up this job:

Code:

//STEP0001 EXEC PGM=SORT                                         
//SORTIN   DD   *
TEST RECORD 01 OF 10
TEST RECORD 02 OF 10
TEST RECORD 03 OF 10
TEST RECORD 04 OF 10
TEST RECORD 05 OF 10
TEST RECORD 06 OF 10
TEST RECORD 07 OF 10
TEST RECORD 08 OF 10
TEST RECORD 09 OF 10
TEST RECORD 10 OF 10                                               
DATASET1                                                         
/*                                                               
//SORTOUT  DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO                   
//SYSOUT   DD   SYSOUT=*                                         
//SYSIN    DD   *                                               
  OPTION COPY                                                   
  OUTFIL BUILD=(1,80,256:X)                                     
/*                                                               
//*                                               
//STEP0002 EXEC PGM=SORT                         
//SORTIN   DD   *                     
TEST RECORD 01 OF 10
TEST RECORD 02 OF 10
TEST RECORD 03 OF 10
TEST RECORD 04 OF 10
TEST RECORD 05 OF 10
TEST RECORD 06 OF 10
TEST RECORD 07 OF 10
TEST RECORD 08 OF 10
TEST RECORD 09 OF 10
TEST RECORD 10 OF 10           
DATASET2                                         
/*                                               
//SORTOUT  DD   DSN=&&T2,DISP=(,PASS),UNIT=VIO   
//SYSOUT   DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  OPTION COPY                                     
  OUTFIL BUILD=(1,80,256:X)                       
/*                                               
//*       
//STEP0003 EXEC PGM=IEBGENER                                 
//SYSUT1   DD   DSN=&&T1,DISP=(OLD,DELETE)                   
//         DD   DSN=&&T2,DISP=(OLD,DELETE)                   
//SYSUT2   DD   DSN=HLQ.FB256.PDS,                       
//         DISP=(,CATLG,DELETE),UNIT=SYSDA,               
//         SPACE=(CYL,(10,10,10),RLSE)                 
//SYSPRINT DD   SYSOUT=*                                     
//SYSIN    DD   *                                           
     GENERATE  MAXNAME=3,MAXGPS=2                           
       MEMBER  NAME=MEMBER1                                 
GROUP1 RECORD  IDENT=(8,'DATASET1',1)                       
       MEMBER  NAME=MEMBER2                                 
GROUP2 RECORD  IDENT=(8,'DATASET2',1)                       
       MEMBER  NAME=MEMBER3                                 
/*                                                           


And it worked for me.
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Apr 18, 2012 2:59 am
Reply with quote

SuperK,

If I decipher your code in view of the IEBGENER documentation, then the GROUP RECORD statement will tell IEBGENER that the last record of the first member (MEMBER1) will have DATASET1 in the first 8 characters and the last record of second member (MEMBER2) will have DATASET2 in the first 8 characters. Can I assume that there is some way to use SORT to accomplish that?

Charles
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Apr 18, 2012 3:33 am
Reply with quote

What Sort product do you have? If DFSORT, have a look at TRAILER1. If not, I won't assume as I have no documentation.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Apr 18, 2012 4:04 am
Reply with quote

Hi,

why not just run 2 steps as Dick suggested
Code:
//STEP0001 EXEC PGM=SORT                                   
//SORTIN   DD DSN=RMTPRD.EES.S688CLW.SASDLIB.LOG,           
//            DISP=SHR                                     
//SORTOUT  DD DSN=S688CLW.SASWORK.SASOUT(MYSASLOG),         
//            DISP=(NEW,CATLG,DELETE),                     
//            UNIT=SYSPRD,SPACE=(TRK,(50,10,5))             
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
/*                                                         
//*                                                         
//STEP0002 EXEC PGM=SORT                                   
//SORTIN   DD DSN=RMTPRD.EES.S688CLW.SASDLIB.LST,           
//            DISP=SHR                                     
//SORTOUT  DD DSN=S688CLW.SASWORK.SASOUT(MYSASLST),         
//            DISP=SHR                                     
//         DISP=SHR                                         
//SYSOUT   DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
/*


Also, do both files have the same DCB attributes ?


Gerry
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 18, 2012 12:46 pm
Reply with quote

Why not use REPRO ?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Apr 18, 2012 12:51 pm
Reply with quote

Why not use IEBUPDTE ?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 18, 2012 1:00 pm
Reply with quote

Garry Carroll wrote:
Why not use IEBUPDTE ?


Why NOT to use IEBUPDTE :

You can use IEBUPDTE to create or modify sequential or partitioned data sets or PDSEs. However, the program can be used only with data sets containing fixed-length records of no more than 80 bytes. (It is used primarily for updating procedure, source, and macro libraries, such as those containing JCL.)
Back to top
View user's profile Send private message
Ramsee

New User


Joined: 06 Jan 2011
Posts: 53
Location: Chennai

PostPosted: Wed Apr 18, 2012 2:48 pm
Reply with quote

Hi Charles Wolters,

You can take the below JCL this will do the needful,

//DP005HAU JOB (12345678),'SORT CARD',MSGCLASS=H,
// MSGLEVEL=(1,1),CLASS=A,NOTIFY=&SYSUID
//STEP01 EXEC PGM=IEBCOPY
//SYSPRINT DD SYSOUT=*
//INPUT01 DD DSN=DP005H.TEST.JCLLIB,DISP=SHR
//OUTPUT DD DSN=DP005H.TEST.UTILITY,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,10,10)),
// DCB=(LRECL=80,RECFM=FB,BUFNO=255)
//SYSIN DD *
COPY OUTDD=OUTPUT,INDD=INPUT01
SELECT MEMBER=((MEM1,MYSASLOG,R),(MEM2,MYSASLST,R))
/*

Please let me know if you found any other solution.

Regards,
Ramsee
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Apr 18, 2012 4:13 pm
Reply with quote

Hi Ramsee,

can you please explain how your example assists Charles.

He has 2 sequential files and wants to create 2 members in a a PDS.

How does your example do this ?


Gerry
Back to top
View user's profile Send private message
Ramsee

New User


Joined: 06 Jan 2011
Posts: 53
Location: Chennai

PostPosted: Wed Apr 18, 2012 4:54 pm
Reply with quote

Sorry Gerry i misunderstood the requirement and i gave a wrong reply.
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Wed Apr 18, 2012 6:30 pm
Reply with quote

I submitted a job last night using Dick's approach (later endorsed by gcicchet) and the job ran successfully. As I am an inquisitive fellow I will look into DFSORT and TRAILER as suggested by Bill and try to implement SuperK's approach when I have some free time. As always, your technical assistance is much appreciated.

Charles
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top