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
 

 

Question on IFTHEN and OVERLAY Statement in DFSORT

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

New User


Joined: 18 Apr 2014
Posts: 2
Location: USA

PostPosted: Tue Oct 21, 2014 11:03 pm    Post subject: Question on IFTHEN and OVERLAY Statement in DFSORT
Reply with quote

Hi,
I have a requirement where i need to replace few characters at two different positions. But when try using below SORT Card, it replaces only the first OVERLAY statement(Position 72) and second OVERLAY statement(Position 82) was not executed. Will someone able to explain whether i need to change the SORT Card Parameters or we can do it in this method.

Sort Card :
OPTION COPY
OUTREC IFTHEN=(WHEN=(72,10,CH,EQ,C'9999-99-99'),
OVERLAY=(72:C'0001-01-01')),
IFTHEN=(WHEN=(82,10,CH,EQ,C'9999-99-99'),
OVERLAY=(82:C'0001-01-01'))
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Oct 21, 2014 11:46 pm    Post subject: Reply to: Question on IFTHEN and OVERLAY Statement in DFSORT
Reply with quote

Code:
HIT=NEXT
?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Oct 22, 2014 3:40 am    Post subject: Reply to: Question on IFTHEN and OVERLAY Statement in DFSORT
Reply with quote

Spot on Nic.

narein207,

Once an IFTHEN=(WHEN=(logical-expression) is true for the current record, IFTHEN processing stops unless , when you want to make another test for an unrelated condition on the same record, then you have to specify HIT=NEXT, which will cause processing to continue until another IFTHEN=(WHEN=(logical-expression) is satisfied, or until there are no more IFTHEN tests.

And please use the Code tags.

Code:
OPTION COPY
 INREC IFTHEN=(WHEN=(72,10,CH,EQ,C'9999-99-99'),
                     OVERLAY=(72:C'0001-01-01'),HIT=NEXT),
       IFTHEN=(WHEN=(82,10,CH,EQ,C'9999-99-99'),
                     OVERLAY=(82:C'0001-01-01'))


You might also want to look at using CHANGE. Consult the manual and see what you think.
Back to top
View user's profile Send private message
narein207

New User


Joined: 18 Apr 2014
Posts: 2
Location: USA

PostPosted: Wed Oct 22, 2014 11:04 pm    Post subject:
Reply with quote

Thanks a lot Nic and Bill. Let me test and will also look at using CHANGE.
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm


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