|
View previous topic :: View next topic
|
| Author |
Message |
narein207
New User

Joined: 18 Apr 2014 Posts: 2 Location: USA
|
|
|
|
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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
|
? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
narein207
New User

Joined: 18 Apr 2014 Posts: 2 Location: USA
|
|
|
|
| Thanks a lot Nic and Bill. Let me test and will also look at using CHANGE. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|