sort card for eliminating records having 49 9's



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

sort card for eliminating records having 49 9's

Postby Ashok Raju » Tue Oct 25, 2011 3:59 pm

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
Ashok Raju
 
Posts: 13
Joined: Tue Oct 25, 2011 3:45 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Tue Oct 25, 2011 9:39 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby Frank Yaeger » Tue Oct 25, 2011 10:48 pm

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)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

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

Postby Ashok Raju » Thu Oct 27, 2011 2:51 pm

Frank,

Thank you very much...
I got it.
Ashok Raju
 
Posts: 13
Joined: Tue Oct 25, 2011 3:45 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post