View previous topic :: View next topic |
Author |
Message |
bullfighter Beginner
Joined: 15 Apr 2005 Posts: 26 Topics: 9
|
Posted: Mon Apr 18, 2005 10:26 am Post subject: Merge two or more files into one |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Mon Apr 18, 2005 10:35 am Post subject: |
|
|
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 |
|
|
bullfighter Beginner
Joined: 15 Apr 2005 Posts: 26 Topics: 9
|
Posted: Mon Apr 18, 2005 10:48 am Post subject: |
|
|
Yes it worked, thanks for ur help |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Mon Aug 01, 2005 1:35 am Post subject: |
|
|
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 |
|
|
Ram Beginner
Joined: 12 Jan 2004 Posts: 53 Topics: 12
|
Posted: Mon Aug 01, 2005 5:18 am Post subject: |
|
|
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 |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 02, 2005 1:13 am Post subject: |
|
|
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 |
|
|
Ram Beginner
Joined: 12 Jan 2004 Posts: 53 Topics: 12
|
Posted: Tue Aug 02, 2005 4:39 am Post subject: |
|
|
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 |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 02, 2005 5:30 am Post subject: |
|
|
Hi All,
Thanks a lot for your help. |
|
Back to top |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 02, 2005 8:12 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Tue Aug 02, 2005 8:19 am Post subject: |
|
|
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 |
|
|
vkphani Intermediate
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 02, 2005 8:25 am Post subject: |
|
|
Hi Kolusu,
Thanks for the help.
It worked fine. |
|
Back to top |
|
|
|
|