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 values using INREC condition

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

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Wed May 20, 2009 6:20 pm    Post subject: Need to replace values using INREC condition
Reply with quote

my input file has the value NLN in 346th position and 01Q in 369th position.
i want to check from the 346th position, if the value is NLN then I have to change it to NLQ.
and i have to check the column 369th position,if the value is 01Q then I have to change it to 01D.

I written below sort condition

Code:

  SORT FIELDS=COPY
  INREC IFTHEN=(WHEN=(346,3,CH,EQ,C'NLN',OR,346,3,CH,EQ,C'NLD',
       OR,346,3,CH,EQ,C'NLQ'),BUILD=(1,345,346:C'NLQ',349,206)),
      IFTHEN=(WHEN=(369,3,CH,EQ,C'01N',OR,369,3,CH,EQ,C'01D',
      OR,369,3,CH,EQ,C'01Q'),BUILD=(1,345,369:C'01D',372,206)),


But i am getting the result only for the column 346,it is not replacing the values to 369th position,

Need help from anyone.

Thanks in advance.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 20, 2009 6:42 pm    Post subject:
Reply with quote

Search for use of HIT=NEXT in IFTHEN
Back to top
View user's profile Send private message
services

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Wed May 20, 2009 6:45 pm    Post subject:
Reply with quote

thanks a lot for your reply..could you please give me an example.
Back to top
View user's profile Send private message
services

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Wed May 20, 2009 6:55 pm    Post subject:
Reply with quote

my code is

Code:

  IFTHEN=(WHEN=(346,3,CH,EQ,C'NLN',OR,346,3,CH,EQ,C'NLD',
   OR,346,3,CH,EQ,C'NLQ'),BUILD=(1,345,346:C'NLQ',349,206)),
  IFTHEN=(WHEN=(346,3,CH,EQ,C'01N',OR,346,3,CH,EQ,C'01D',
   OR,346,3,CH,EQ,C'01Q'),BUILD=(1,345,346:C'01D',349,206)),
  IFTHEN=(WHEN=(346,3,CH,EQ,C'02N',OR,346,3,CH,EQ,C'02D',
   OR,346,3,CH,EQ,C'02Q'),BUILD=(1,345,346:C'02D',349,206)),
  IFTHEN=(WHEN=(346,3,CH,EQ,C'04N',OR,346,3,CH,EQ,C'04D',
   OR,346,3,CH,EQ,C'04Q'),BUILD=(1,345,346:C'04D',349,206)),


the above values I have to replace to the positions 369 and 395,415

If possible could you please provide a piece of code.
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: Wed May 20, 2009 8:38 pm    Post subject:
Reply with quote

I don't think your control statements are what you actually want based on your statement "the above values I have to replace to the positions 369 and 395,415". All of your WHEN conditions have 346,3 but I assume they should have 369,3, 395,3 and 415,3 as well. At any rate, if you do have different positions in different clauses, then you can use HIT=NEXT for all but the last IFTHEN clause:

Code:

  INREC IFTHEN=(WHEN=(346,3,CH,EQ,C'NLN',OR,346,3,CH,EQ,C'NLD',         
   OR,346,3,CH,EQ,C'NLQ'),BUILD=(1,345,346:C'NLQ',349,206),HIT=NEXT),   
  IFTHEN=(WHEN=(346,3,CH,EQ,C'01N',OR,346,3,CH,EQ,C'01D',               
   OR,346,3,CH,EQ,C'01Q'),BUILD=(1,345,346:C'01D',349,206),HIT=NEXT),   
  IFTHEN=(WHEN=(346,3,CH,EQ,C'02N',OR,346,3,CH,EQ,C'02D',               
   OR,346,3,CH,EQ,C'02Q'),BUILD=(1,345,346:C'02D',349,206),HIT=NEXT),   
  IFTHEN=(WHEN=(346,3,CH,EQ,C'04N',OR,346,3,CH,EQ,C'04D',               
   OR,346,3,CH,EQ,C'04Q'),BUILD=(1,345,346:C'04D',349,206))             
Back to top
View user's profile Send private message
services

New User


Joined: 20 May 2009
Posts: 38
Location: India

PostPosted: Wed May 20, 2009 10:37 pm    Post subject:
Reply with quote

Thanks Frank, really great help!!
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 Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts INREC PARSING and dictionary items migusd SYNCSORT 6 Fri Jun 02, 2017 8:02 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 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
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us