Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Insert data at a particular position

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Insert data at a particular position
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    Post subject:
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

http://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    Post subject: Reply to: Insert data at a particular position
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: 1756
Location: UK

PostPosted: Sat Jun 18, 2011 5:00 pm    Post subject:
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    Post subject: Re: Reply to: Insert data at a particular position
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us