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: 6967
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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