Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us