My age field starts from 21st column.I want to include all records with age >=22.
But iam getting abend for the above code.
Iam able to include alphanumeric fields & sort.
Please help me out.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Or alternatively:
Code:
//SYSIN DD *
INCLUDE COND=(21,2,ZD,GE,22)
SORT FIELDS=(3,18,CH,A,21,2,BI,D)
/*
If you compare a BI value to a decimal number (22), the BI value is interpreted as a binary number, so a value of '22' in the record is interpreted as its binary value of X'F2F2' = 62194. If you compare a BI value to a character constant ('22'), the BI value is interpreted as a character value, so a value of '22' in the record is interpreted as '22'. Thus 21,2,BI,GE,22 will not do what you want, but 21,2,BI,GE,C'22' will.
Alternatively you can treat the '22' as a ZD value of 22 and compare it to a decimal constant of 22, so 21,2,ZD,GE,22 will do what you want.
Note that using CH works fine as long as the numbers in the record use F as the sign. ZD works regardless of what's used as the sign (e.g. F, C or D).