Page 1 of 1

copy only records with NON-NUMERIC data

PostPosted: Sat Oct 04, 2008 8:22 pm
by ranga_subham
Hi,

We have a file with millions of records and need to copy only those records which have non-numeric data in position 10 (length 20).

How to write INCLUDE condition for this in Syncsort v1.2.3.1R?

Please help.

Thanks.

Re: copy only records with NON-NUMERIC data

PostPosted: Mon Oct 06, 2008 8:29 pm
by Alissa Margulies
The easiest solution is available in SyncSort for z/OS 1.3:
//SYSIN DD *
    SORT FIELDS=COPY
    INCLUDE COND=(10,20,ZD,NE,NUM)


But I believe the following code should produce the desired results as well:
//SYSIN DD *                                         
   SORT FIELDS=COPY                                 
   OMIT COND=(10,1,CH,GE,C'0',AND,10,1,CH,LE,C'9',AND,
       11,1,CH,GE,C'0',AND,11,1,CH,LE,C'9',AND,
       12,1,CH,GE,C'0',AND,12,1,CH,LE,C'9',AND,
       13,1,CH,GE,C'0',AND,13,1,CH,LE,C'9',AND,
       14,1,CH,GE,C'0',AND,14,1,CH,LE,C'9',AND,
       15,1,CH,GE,C'0',AND,15,1,CH,LE,C'9',AND,
       16,1,CH,GE,C'0',AND,16,1,CH,LE,C'9',AND,
       17,1,CH,GE,C'0',AND,17,1,CH,LE,C'9',AND,
       18,1,CH,GE,C'0',AND,18,1,CH,LE,C'9',AND,
       19,1,CH,GE,C'0',AND,19,1,CH,LE,C'9',AND,
       20,1,CH,GE,C'0',AND,20,1,CH,LE,C'9',AND,
       21,1,CH,GE,C'0',AND,21,1,CH,LE,C'9',AND,
       22,1,CH,GE,C'0',AND,22,1,CH,LE,C'9',AND,
       23,1,CH,GE,C'0',AND,23,1,CH,LE,C'9',AND,
       24,1,CH,GE,C'0',AND,24,1,CH,LE,C'9',AND,
       25,1,CH,GE,C'0',AND,25,1,CH,LE,C'9',AND,
       26,1,CH,GE,C'0',AND,26,1,CH,LE,C'9',AND, 
       27,1,CH,GE,C'0',AND,27,1,CH,LE,C'9',AND, 
       28,1,CH,GE,C'0',AND,28,1,CH,LE,C'9',AND, 
       29,1,CH,GE,C'0',AND,29,1,CH,LE,C'9')
/*   

Re: copy only records with NON-NUMERIC data

PostPosted: Mon Oct 06, 2008 10:14 pm
by ranga_subham
I've tried this and it worked as expected........Thanks.