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
 

 

Need to replace a word with another without using IFTHEN

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to replace a word with another without using IFTHEN
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

Site Director


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

PostPosted: Fri Aug 31, 2007 7:46 am    Post subject:
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    Post subject: Reply to: Need to replace a word with another without using
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: 1288
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 9:25 am    Post subject: Reply to: Need to replace a word with another without using
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: 1288
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 9:29 am    Post subject: Reply to: Need to replace a word with another without using
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    Post subject: Reply to: Need to replace a word with another without using
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: 1288
Location: Chennai, India

PostPosted: Fri Aug 31, 2007 11:39 am    Post subject: Reply to: Need to replace a word with another without using
Reply with quote

You are welcome icon_biggrin.gif
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: Fri Aug 31, 2007 9:10 pm    Post subject:
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    Post subject:
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    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 Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts Need a help how to replace a string i... gurunath82 CLIST & REXX 12 Tue Jul 26, 2016 11:43 pm
No new posts DFSORT - FIND AND REPLACE Other Field... Arunraj Murugaiyan DFSORT/ICETOOL 6 Fri Feb 12, 2016 1:52 pm


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