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
 

 

Need to 'replace' some data in a comma delimited file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
HammerTime

New User


Joined: 26 Sep 2012
Posts: 14
Location: UK

PostPosted: Tue May 28, 2013 5:22 pm    Post subject: Need to 'replace' some data in a comma delimited file
Reply with quote

We have a need to FTP a .csv file onto the mainframe, then we're going to load this directly to DB2. Only thing is, I want to replace some generic data (part of the audit fields) with a system generated value.

Now this would be easy enough with a 'normal' dataset, but because we need to use a .csv file, the data we need to replace will be at various different offsets. What i'm hoping to achieve is to replace 'RESUME' with 'AAnnnnnn' and the file could look something like this:
Code:

TEST1,100034,BLAH,BLAH,BLAH,RESUME,0001,2013-01-01-01.00.00.000000
TEST 2,3242,YADA,YADA,YADA,RESUME,0001,2013-01-01-01.00.00.000000
TEST333,34534575,X,Y,Z,RESUME,0001,2013-01-01-01.00.00.000000


Was wondering if I could use an OVERLAY, but not sure if this can be done without providing a fixed offset. Is this something which can be done in SORT or ICETOOL?
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue May 28, 2013 6:01 pm    Post subject:
Reply with quote

Will ",RESUME," only appear in the 6th field or could that string appear elsewhere? If it's consistent, FINDREP might do the trick for you.

Code:
OUTREC FINDREP=(IN=C',RESUME,',OUT=C',AAnnnnnn,')


Garry.
Back to top
View user's profile Send private message
HammerTime

New User


Joined: 26 Sep 2012
Posts: 14
Location: UK

PostPosted: Tue May 28, 2013 6:30 pm    Post subject:
Reply with quote

Garry, you are a star! That works a treat.

The string could appear elsewhere in these files(there are up to 200 different incoming file formats, which is why I wanted to do this as part of a global SORT rather than write a COBOL service).

FINDREP is my new favourite SORT function!
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue May 28, 2013 6:35 pm    Post subject:
Reply with quote

Only too glad to have been of help ! icon_biggrin.gif icon_cool.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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