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
 
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: 1922
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: 7314

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 Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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