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

Concatenate 2 input datasets and give output to one of input


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

New User


Joined: 05 Aug 2024
Posts: 1
Location: India

PostPosted: Tue Aug 13, 2024 4:35 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Tue Aug 13, 2024 5:29 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Aug 14, 2024 12:36 pm
Reply with quote

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
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 COBOL sorting, with input GDG base COBOL Programming 7
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts JES datasets IO Error ABENDS & Debugging 3
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
Search our Forums:

Back to Top