|
View previous topic :: View next topic
|
| Author |
Message |
srinathds83
New User
Joined: 17 Jul 2007 Posts: 41 Location: pune
|
|
|
|
Hi,
I have a input File with below format:
| Code: |
HDR1 XXXX SRINATHD YYYYYYYY AAAAA BBBBBB $NEWSELLL ----
01,111111111,1111111111,111111,1111,1,11,/
02,2222222222,222222222,1,120704,2222,/
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555
EOF1 XXXX SRINATHD YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 6666666
HDR1 XXXX RAVINDER YYYYYYYY AAAAA BBBBBB $NEWSELLL ----
01,111111111,1111111111,111111,1111,1,11,/
02,2222222222,222222222,1,120704,2222,/
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555
EOF1 XXXX RAVINDER YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 9999999
HDR1 XXXX HEMANTHA YYYYYYYY AAAAA BBBBBB $NEWSELLL ----
01,111111111,1111111111,111111,1111,1,11,/
02,2222222222,222222222,1,120702,2222,/
03,333,33333333,0,3333333333333,NONE,120615 SRINATH
04,4444444444455555555555
EOF1 XXXX HEMANTHA YYYYYYYY AAAAA BBBBBB $NEWSELLL 00000 00000 0000000 22222222 |
If in 02 record level the date is equal to prior date i.e.( today's Date -1). Then write the EOF1 record with only Highlighted Field.
O/P Should be:
| Code: |
SRINATHD | 6666666
RAVINDER | 9999999 |
I have written the Sort Card But it's not working. Please suggest the Solution:
| Code: |
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02',AND,27,6,CH,EQ,Y'DATE1'-1),
END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:ID,2))
OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,2,CH,NE,C' '),
BUILD=(11,8,9X,C' | ',72,8,52X)
/* |
Code'd. Please use the Code tags, not text enhancements, as the Code preserves the space. If anyone wants to use your data for testing, they are not going to bother if it has enhancements to delete everywhere. |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| How is it not working? Also, you seem to have managed to use code tags for you JCL and sort cards but not your data and it is just as important, if not more so, to encode your data. |
|
| Back to top |
|
 |
srinathds83
New User
Joined: 17 Jul 2007 Posts: 41 Location: pune
|
|
|
|
Hi Nic,
when i tried running this Sort Card, It throws an error stating problem with INREC.
Thanks and Regards,
Srinath D. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
May be try this
| Code: |
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02'),
END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:27,6))
OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,6,Y2T,EQ,Y'DATE1'-1),
BUILD=(11,8,9X,C' | ',72,8,52X)
|
|
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| WHAT error - just post your messages |
|
| Back to top |
|
 |
srinathds83
New User
Joined: 17 Jul 2007 Posts: 41 Location: pune
|
|
|
|
| Pandora-Box wrote: |
May be try this
| Code: |
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02'),
END=(1,4,CH,EQ,C'EOF1'),PUSH=(81:27,6))
OUTFIL INCLUDE=(1,4,CH,EQ,C'EOF1',AND,81,6,Y2T,EQ,Y'DATE1'-1),
BUILD=(11,8,9X,C' | ',72,8,52X)
|
|
Thanks !!!! This worked perfectly. After changing the Comparision value to Y2T even my Sort Card ran perfectly.
Thanks and Regards,
Srinath |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|