View previous topic :: View next topic
|
Author |
Message |
KeerthiSree
New User
Joined: 05 Aug 2024 Posts: 1 Location: India
|
|
|
|
I want to concatenate 2 datasets ( say A,B) and give the output to B dataset using IEBGENER utility.
I used following:
//SYSUT1 DD DSN=A,DISP=SHR
// DD DSN=B,DISP=SHR
//SYSUT2 DD DSN=B,DISP=OLD
Its not giving any error but Im getting only A dataset data in output.
Only when I gave SYSUT2 DISP as MOD, then only I can see concatenated data but Im getting data in B like below:
B file data
A file data
B file data
But I wanted data in B as below:
A file data
B file data
I tried with different DISP but none of them worked.
Can anyone please let me know if it is possible to achieve this using IEBGENER in single step?
If we use a dataset as both input and output in a single step(as above), then what disposition parameter would apply to the dataset while executing? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
0. This is neither JCL, not VSAM.
1. Learn to be polite to your readers:
KeerthiSree wrote: |
I want to concatenate 2 datasets (say A,B) and give the output to B dataset using IEBGENER utility.
I used following:
Code: |
//SYSUT1 DD DSN=A,DISP=SHR
// DD DSN=B,DISP=SHR
//SYSUT2 DD DSN=B,DISP=OLD |
Its not giving any error but Im getting only A dataset data in output.
Only when I gave SYSUT2 DISP as MOD, then only I can see concatenated data but Im getting data in B like below:
B file data
A file data
B file data
But I wanted data in B as below:
A file data
B file data
I tried with different DISP but none of them worked.
Can anyone please let me know if it is possible to achieve this using IEBGENER in single step?
If we use a dataset as both input and output in a single step(as above), then what disposition parameter would apply to the dataset while executing? |
2. You should not override your DSN=B before it has been used for copying to the end of itself!
You may need to use intermediate (temporary) dataset to combine the data A+B, or some other trick - to not override the data yet not used! |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
You can use SORT like shown below. Just remember that it is specifically recommended not to have SORTOUT the same as SORTIN, so if something breaks, don't call IBM.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=MY.TEST.DS2
// DD DISP=SHR,DSN=MY.TEST.DS1
//SORTOUT DD DISP=SHR,DSN=MY.TEST.DS1
//SYSIN DD *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
|