Problem....



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

Problem....

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)
INCLUDE COND=(1,1,CH,EQ,C'A').

Thanks In Advance!!
sakmajor
 
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.
  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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 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.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post