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

Insert data at a particular position


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

New User


Joined: 18 Jul 2008
Posts: 59
Location: Bangalore

PostPosted: Sat May 28, 2011 7:12 pm
Reply with quote

Hi,

I need to insert data at a particular position of all the records in a dataset. Consider the below records
Code:

ABCD   EF
LMNO   PQ
RSTU   WX

Now I need to insert XX at Column position 5 and 6 for all the records.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sat May 28, 2011 8:32 pm
Reply with quote

Here is step will do desired....
(Provided you want 5th and 6th position to be replaced by XX)
Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DISP=SHR,DSN=YOUR.INPUT.FILE.HERE           
//SORTOUT  DD DSN=YOUR.OUTPUT.FILE.HERE                   
//SYSIN    DD *                                           
 OPTION COPY                                               
 INREC OVERLAY=(5:C'XX')                                   


Read through Franks DFSORT Getting started instead of blindly using these solutions... See

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080

Cheers
Back to top
View user's profile Send private message
mushreyas

New User


Joined: 18 Jul 2008
Posts: 59
Location: Bangalore

PostPosted: Sat Jun 18, 2011 4:42 pm
Reply with quote

Thanks Escapa... Does OVERLAY increases the length of the file or does it overrides in the desired position?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jun 18, 2011 5:00 pm
Reply with quote

It is OVERLAY not INSERT so what do you think?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sun Jun 19, 2011 5:04 am
Reply with quote

mushreyas wrote:
Thanks Escapa... Does OVERLAY increases the length of the file or does it overrides in the desired position?

Later is true
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 2
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 SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top