View previous topic :: View next topic
|
Author |
Message |
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
Hello All,
I have the following requirement.
Input file: Length 50
Output file: Length 50
In my i/p file if 10 byte till 14th byte is either '11111' or '22222' or '33333'
then overwrite the packed decimal value in position 20, with new Packed decimal value.
Note this packed decimal field is date field (in format YYMMDD), so sometimes the value can be '11224' which stands for
YY-> 2001
MM->12
DD-> 24
I want to change the date to 20129 which stands for - 2002-01-29.
I/P date is not constant (It varies based on '11111' or '22222' but output date is constant (20129).Whatever may be the date in the input file for mentioned condition, I need to override with date - "20129" (Packed format).
Here preceding 0 is getting suppressed only for YY, and not for MM and DD.
I hope I have given enough details, If not kindly please let me know of any additional information required.
Thanks for your help. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Can you post a sample input with different conditions and output expected...
Please use code tags !! |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
thunderstorm,
Use the following DFSORT control cards.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(10,5,SS,EQ,C'11111,22222,33333'),
OVERLAY=(20:+20129,TO=PD,LENGTH=3))
//* |
|
|
Back to top |
|
|
thunderstorm
New User
Joined: 23 Mar 2007 Posts: 35 Location: pune
|
|
|
|
Skolusu,
Thanks a ton! It works as expected. |
|
Back to top |
|
|
|