Page 1 of 1

Problem....

PostPosted: Thu Apr 25, 2013 11:35 am
by sakmajor
I have a input file PS in which there are two columns of name and age. I want to sort it in a manner that the display should only consist of name starting with 'A' as well as age equal to or more than 20.

I know It will be done by sort and include condition, But I want to know the exact syntax. Please help me....

The logic I tried using was: SORT FIELDS=(1,1,CH,A)
INCLUDE COND=(1,1,CH,EQ,C'A').

Thanks In Advance!!

Re: Problem....

PostPosted: Thu Apr 25, 2013 12:03 pm
by BillyBoyo
At the moment you are INCLUDEing all those names which start with A, the sorting on that single letter, which is not needed.

To also do the date processing, you'll need an AND in your INCLUDE.
  INCLUDE COND=(1,1,CH,EQ,C'A'
             AND,start,length,type,GE,20)


If you want the output file in "age order", you can then SORT on start,length,type,A. You still won't need to SORT on the name character.

Please tell us if you are using DFSORT or SyncSort, so this can be moved to the correct forum here.

Re: Problem....

PostPosted: Thu Apr 25, 2013 1:16 pm
by NicC
Note that sequential files do not have columns - they have fields. Records have column numbers - an 80 byte record will have 80 columns. DB2 tables have columns