IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to replace a word with another without using IFTHEN


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Fri Aug 31, 2007 7:09 am
Reply with quote

Hi,

I am having record like this.

abcdefgh12345ijkl
asdfghjk12345jklk
vnjklkdd00000jkjk

when ever i find 12345 on position 9, i have to replace with 67890. but I am not allowed to use IFTHEN. I tried it in some other ways. output is coming but in too many steps. (filtered the records having 12345, then used OUTREC and finally merged).

Is there any simple way to handle this?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 31, 2007 7:46 am
Reply with quote

Hello,

Please explain the IFTHEN restriction icon_confused.gif
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Fri Aug 31, 2007 8:32 am
Reply with quote

Hi Dick,

According to our coding standards, we shouldn't use that. That's all.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 9:25 am
Reply with quote

Try using DFSORT's CHANGE function.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 9:29 am
Reply with quote

Use the following sort card

Code:

//S1    EXEC  PGM=ICEMAN                                             
//SYSOUT    DD  SYSOUT=*                                             
//SORTIN DD *                                                       
ABCDEFGH12345IJKL                                                   
ASDFGHJK12345JKLK                                                   
VNJKLKDD00000JKJK                                                   
/*                                                                   
//SORTOUT DD DSN= output file...
//SYSIN    DD    *                                                   
  OPTION COPY                                                       
  INREC OVERLAY=(9:9,5,CHANGE=(5,C'12345',C'67890'),                 
  NOMATCH=(9,5))                                                     
/*                                                                   


Output:

Code:

ABCDEFGH67890IJKL     
ASDFGHJK67890JKLK     
VNJKLKDD00000JKJK     
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Fri Aug 31, 2007 10:14 am
Reply with quote

Thanks AARU. CHANGE solved the problem
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 11:39 am
Reply with quote

You are welcome icon_biggrin.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Aug 31, 2007 9:10 pm
Reply with quote

Quote:
According to our coding standards, we shouldn't use that. That's all.


Strange standard. Are you allowed to use OVERLAY? Given that OVERLAY and IFTHEN have both been available with DFSORT since Dec, 2004, that would make the standard even stranger. Perhaps it's time to question the standards? Your site is paying for all of these functions in DFSORT, so why not take advantage of them?

CHANGE works ok for this particular situation, but there are many situations where IFTHEN is required.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 31, 2007 9:40 pm
Reply with quote

More then likely the standard is for JCL, while you and I know that sort control cards are not JCL a lot of people don't.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
Search our Forums:

Back to Top