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
 
Find and Replace with AND condition

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

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Thu Apr 23, 2009 10:53 pm    Post subject: Find and Replace with AND condition
Reply with quote

Hi all,

I have a requirement, in which If there is "40" at posistion 10 AND "09" at position 12 i need to replace the "09" to "90" and write the entire record

if the AND condition is not statisfied i need to write the entire record of the file unaltered to the output file.

hope i have explained the rq clearly ...please write back if not.

could some one please explain me how to do this .. using Sort

Thanks !!
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 23, 2009 11:07 pm    Post subject:
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
R01      4009
R02      4010
R03      4109
R04      4009
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
   OPTION COPY
   INREC IFTHEN=(WHEN=(10,2,CH,EQ,C'40',AND,12,2,CH,EQ,C'09'),
      OVERLAY=(12:C'90'))
/*


SORTOUT will have:

Code:

R01      4090 
R02      4010 
R03      4109 
R04      4090 
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 67
Location: 125.16.180.5

PostPosted: Thu Apr 23, 2009 11:20 pm    Post subject:
Reply with quote

Thanks Frank,
you people have never let me down icon_smile.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 Do we have any Modern tools to replac... NajeebKR Compuware & Other Tools 4 Sat Jan 27, 2018 1:22 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm

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