Posted: Thu Feb 27, 2003 6:17 am Post subject: JCL for Selecting records from a PS.
Hi,
I have this really really huge PS which I have to process. However, for the Testing Part, Its not a good idea to use this entire file. Im looking out for a JCL using which I can take out the first 1000, 2000, 10000 or so records. Any one with something like this.
What about some conditions we want to put into the records we want to pull out. Say fields 4-6 should have this value and fields 10-14 should have this value and pull out a total of the first 1000, 2000 or so records matching this criteria. Would this be possible too.
You can use the INCLUDE statement if you want to keep the first n records with the condition you specify (e.g. n=1000 to get the first 1000 records that match the condition). You can leave out the INCLUDE statement if you just want to keep the first n records (e.g. n=10000 to get the first 10000 records). _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Dec 2002 Posts: 20 Topics: 8 Location: Chennai, India
Posted: Tue Apr 29, 2003 4:33 am Post subject:
Hi
Suppose I want to copy the records with different conditions
in different files?
Example in the code:
INCLUDE COND=(4,3,CH,EQ,C'ABC',AND,10,5,CH,EQ,C'MANOJ')
these need to be put in one file and records which satisfying the following
INCLUDE COND=(4,3,CH,EQ,C'ABC',AND,10,5,CH,EQ,C'NEELS')
in another file..how to code this?
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Apr 29, 2003 10:55 am Post subject:
Manoj,
The steps you show for SORT and ICEMAN will work with both. SORT FIELDS=COPY and OPTION COPY are equivalent. DFSORT accepts both of them and I believe our competitor does as well. The PGM=ICETOOL step you show for DFSORT's ICETOOL is actually the equivalent of the SORT and ICEMAN steps. FNAMES or FILES can be used in all cases.
My point is that you're making it look like different DFSORT control statement syntax is needed for these three methods, when in fact, the same DFSORT control statement syntax will work for all of them. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Thanks Frank!!! I thought that was the syntax of each of the utilities!!! Nice to know it supports both. Moreover, the FNAMES and FILES got cleared for me too. Thanks!
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Wed Dec 29, 2004 5:53 pm Post subject:
On the same lines if I need to evaluate a complex criteria for records selection from a flat file as below
Quote:
Tax Withheld >=15% of the Paid amount
If this is possible , pls tell me how. Tax witheld and Paid amount are 2 fields starting at 180 and 192 positions respectively and of length 12 in a file of length 465.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Dec 30, 2004 12:39 am Post subject:
Vini,
You need to provide more details. You gave the starting position of Tax withheld and Paid Amount Fields, but what about the Picture Clauses for these fields.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Dec 30, 2004 12:59 am Post subject:
Vini,
You can try this untested version. I assumed that your Tax witheld and Paid amount are defined as 9(12). we calculate the 15% of paid amount at pos 466 for every record. Now using include cond on OUTFIL we select the desired records.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT DSN,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT DSN,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,465, $ total lrecl
(+15,MUL,192,12,ZD), $ 15 times paid amount
DIV,+100, $ divide by 100
M11,LENGTH=12) $ result in zd format of 12 bytes
OUTFIL INCLUDE=(180,12,ZD,GE,466,12,ZD), $ compare tax withheld to result
OUTREC=(1,465) $ strip off the result
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum