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 

Merge two or more files into one

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
bullfighter
Beginner


Joined: 15 Apr 2005
Posts: 26
Topics: 9

PostPosted: Mon Apr 18, 2005 10:26 am    Post subject: Merge two or more files into one Reply with quote

Hi,
I need to merge 2 or more members of different datasets into one member. can someone help me in this.

Input : sat DATASET1, DATASET2, DATASET3 are datasets, and MEMBER1, MEMBER2, MEMBER3 be the members in the corresponding datasets.

I need to merge these members into DATASET4(MEMBER4)

Thanks in advance,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Apr 18, 2005 10:35 am    Post subject: Reply with quote

bullfighter,

You can simply concatenate the members as shown below and create a new member in a existing pds

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=DATASET1(MEMBER1),
//            DISP=SHR
//         DD DSN=DATASET2(MEMBER2),
//            DISP=SHR
//         DD DSN=DATASET3(MEMBER3),
//            DISP=SHR
//SORTOUT  DD DSN=DATASET4(MEMBER4),
//            DISP=OLD
//SYSIN    DD *
  SORT FIELDS=COPY
/*


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


Joined: 15 Apr 2005
Posts: 26
Topics: 9

PostPosted: Mon Apr 18, 2005 10:48 am    Post subject: Reply with quote

Yes it worked, thanks for ur help
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Mon Aug 01, 2005 1:35 am    Post subject: Reply with quote

Kolusu,

I have used the same JCL for concatenating two sequential files with LRECL as 1156 and 603.RECFM for both the files is FB.
I am getting this error: OPEN ERROR SORTIN.
Back to top
View user's profile Send private message Send e-mail
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Mon Aug 01, 2005 5:18 am    Post subject: Reply with quote

Paneendra,

You cannot concatenate FB datasets with different record lengths. I suggest that you pad spaces to the smaller file and then try concatenating both the files.

Thanks,
Ram
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Aug 02, 2005 1:13 am    Post subject: Reply with quote

Hi,

Instead of copying, is there any utility using which we can pad the smallest lrecl dataset with either spaces or low-values.
Back to top
View user's profile Send private message Send e-mail
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Tue Aug 02, 2005 4:39 am    Post subject: Reply with quote

Paneendra,

Use sort to pad spaces to the smaller lrecl file. I am including the sample sort control statements below. Your sortin should be the small lrecl file. The sortout dataset will be created with lrecl equal to 1156.

SORT FIELDS=COPY
OUTREC FIELDS=(1,603,553X)

Thanks,
Ram
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Aug 02, 2005 5:30 am    Post subject: Reply with quote

Hi All,

Thanks a lot for your help.
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Aug 02, 2005 8:12 am    Post subject: Reply with quote

Hi,

I am merging 25 input files into an output file.
All the input files and output file is of format VB.
But the record length of the input files are not same.
But if I look at the output file, sorting is not happening.

Here is the JCL.
Code:

//STEP026  EXEC PGM=SORT
//SYSUDUMP DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=TTOI.RBSUCETL.INVSTGTN.CWKSXZAI.MERGIN1,DISP=SHR     
//         DD DSN=TTOI.RBSUCETL.INVSTGTN.CWKSXZAI.MERGIN2,DISP=SHR     
//         DD DSN=TTOI.RBSUCETL.INVSTGTN.CWKSXZAI.MERGIN3,DISP=SHR


//SORTOUT  DD DSN=TTOI.RBSUCETL.INVSTGTN.CWKSXZAI.MERGEOUT,
//             DISP=(NEW,CATLG,KEEP),                                   
//             SPACE=(CYL,(100,10),RLSE),                               
//             RECFM=VB,LRECL=1184                                       
//SYSIN    DD *                                                         
  SORT FIELDS=(1,6,CH,A,39,10,ZD,A,49,6,ZD,A,55,8,ZD,A)                 
/*                                                                     
//*   

Could you please let me know whats happening here.
Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 02, 2005 8:19 am    Post subject: Reply with quote

Quote:

All the input files and output file is of format VB. But the record length of the input files are not same. But if I look at the output file, sorting is not happening.


Vkphani,

when you say your input files are of Variable block did you consider the RDW when specifying the sort fields? If your intention is to sort the field at pos 1 , then the you should specify the start position as 5 as the first 4 bytes is rdw of each record.

So change your sort to accomadate the RDW

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
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Aug 02, 2005 8:25 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for the help.
It worked fine.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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