Page 1 of 1

sort card for eliminating records having 49 9's

PostPosted: Tue Oct 25, 2011 3:59 pm
by Ashok Raju
Hi,

My requirement is to fetch records which do not have 49 9's in position 1-49. I used the following sort card
  sort fields=copy
  omit cond=(1,49,ch,eq,c'9999999999999999999999999999999999999999999999999')

I got correct result, still i'm looking for easy method.

Can anyone tell me how to write the sort card instead of using all 49 9's, and which sort tool I have to use.

Thanks,
Ashok Raju

Re: sort card for eliminating records having 49 9's

PostPosted: Tue Oct 25, 2011 9:39 pm
by dick scherrer
Hello and welcome to the forum,

I got correct result, still i'm looking for easy method.
As your working solution requires only ONE statement, this IS an easy method. . .

and which sort tool I have to use.
What does this mean? The sort IS a tool.

If you post which sort product is used on your system, your topic will be moved to the proper part of the forum.

Re: sort card for eliminating records having 49 9's

PostPosted: Tue Oct 25, 2011 10:48 pm
by Frank Yaeger
Ashok,

If you want to avoid coding 49 9's, you can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION COPY
  INREC OVERLAY=(81:49C'9')
  OUTFIL OMIT=(1,49,CH,EQ,81,49,CH),BUILD=(1,80)
/*

Re: sort card for eliminating records having 49 9's

PostPosted: Thu Oct 27, 2011 2:51 pm
by Ashok Raju
Frank,

Thank you very much...
I got it.