JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...


Postby sakmajor » Thu Apr 25, 2013 11:35 am

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)

Thanks In Advance!!
Posts: 1
Joined: Thu Apr 25, 2013 11:09 am
Has thanked: 0 time
Been thanked: 0 time

Re: Problem....


Re: Problem....

Postby BillyBoyo » Thu Apr 25, 2013 12:03 pm

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.

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.
Global moderator
Posts: 3732
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 254 times

Re: Problem....

Postby NicC » Thu Apr 25, 2013 1:16 pm

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
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Global moderator
Posts: 2509
Joined: Sun Jul 04, 2010 12:13 am
Location: Down on the pig farm
Has thanked: 4 times
Been thanked: 86 times

Return to JCL


  • Related topics
    Last post