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
 

 

Replacing multiple strings at different locations in a file

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Oct 13, 2010 7:39 pm    Post subject: Replacing multiple strings at different locations in a file
Reply with quote

My file length is 120 characters.

My requirement is to change
1) the string @ location 12 from 'A1' to 'K7'
AND
2) the string @ location 43 from 'B1' to 'K8'


I used the following sort card.


Code:
//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(12,2,CH,EQ,C'A1'),OVERLAY=(12:C'K7'),
            IFTHEN=(WHEN=(43,2,CH,EQ,C'B1'),OVERLAY=(43:C'K8'))
/*



Result:
A1 is replacing with K7 successfully, since the first condition is satisfied, the second condition is not being processed and the record gets processed.

Please let me know how to achieve this requirement.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Oct 13, 2010 7:45 pm    Post subject:
Reply with quote

it may have something to do with the HIT=NEXT
look it up in the manual,
links are: http://www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000080

or search the DFSORT forum for HIT. I remember somebody explaining how it works.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 8:34 pm    Post subject:
Reply with quote

Hello,

Read about HIT=NEXT. . .
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Oct 13, 2010 9:25 pm    Post subject: Hi
Reply with quote

thanks dbzTHEdinosauer & dick.
I got it now.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 13, 2010 9:59 pm    Post subject: Reply to: Replacing multiple strings at different locations
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


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