View previous topic :: View next topic
Author
Message
brindha christy New User Joined: 26 Aug 2008Posts: 20 Location: India
Hi,
I am writing a sort function to strip off the Header and trailer of a file. The header starts with a 0 in the first character and the trailer starts with a 9 in the first character. The details records all start with CID as the first 3 char.
I tried writing these 2 conditions, but i am getting only a empty dataset:
1st Condition:
SORT FIELDS=COPY
OMIT COND=(1,1,CH,EQ,C'0',AND,1,1,CH,EQ,C'9')
Second condition:
SORT FIELDS=COPY
INCLUDE COND=(1,3,CH,EQ,C'CID')
I am not sure why i am getting only an empty dataset as output.
When i give HEX on this is what I see:
0 20080825 2
F4FFFFFFFF4F
002008082502
-----------
CID=C006 /O
CCC7CFFF446D
394E30060016
---------
9200808140
FFFFFFFFFF
Does anyone have any suggestion?
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
Quote:
OMIT COND=(1,1,CH,EQ,C'0',AND,1,1,CH,EQ,C'9')
not sure about the syntax, but the condition should be an OR
Back to top
sri_mf Active User Joined: 31 Aug 2006Posts: 218 Location: India
Brindha can you post your JCL ,input data ..RECFM & LRECL..
Back to top
Aaru Senior Member Joined: 03 Jul 2007Posts: 1287 Location: Chennai, India
Hi,
Quote:
ot sure about the syntax, but the condition should be an OR
It is syntatically correct.
Quote:
Second condition:
SORT FIELDS=COPY
INCLUDE COND=(1,3,CH,EQ,C'CID')
This should fetch you records provided there are records with CID in the first 3 bytes.
Try and post your complete JCL if you face any problem.
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
Is the file FB or VB ?
If VB then use
INCLUDE COND=(5,3,CH,EQ,C'CID')
Back to top
brindha christy New User Joined: 26 Aug 2008Posts: 20 Location: India
When i say OR in the OMIT COND, all the records are copied to the output file.
My JCL is :
Code:
//STEP03 EXEC PGM=SORT
//SORTIN DD DSN=XYZ.ABC.CLIST.TEST2,
// DISP=(OLD,KEEP,KEEP)
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'9')
//SORTOUT DD DSN=XYZ.ABC.CLIST.TEST3,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,20),RLSE)
//SYSOUT DD SYSOUT=*
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
expat wrote:
Is the file FB or VB ?
If VB then use
INCLUDE COND=(5,3,CH,EQ,C'CID')
Back to top
brindha christy New User Joined: 26 Aug 2008Posts: 20 Location: India
Yes
SORT FIELDS=COPY
INCLUDE COND=(5,3,CH,EQ,C'CID')
Worked....Thanks for all your help
Back to top
enrico-sorichetti Superior Member Joined: 14 Mar 2007Posts: 10873 Location: italy
Quote:
// DCB=(RECFM=VB,LRECL=1000,BLKSIZE=27998)
since the dataset is VB using the right offset as expat suggested should
yield the expected results in both cases
Back to top
Please enable JavaScript!