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
 
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 Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am

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