sunojsm Warnings : 1 New User
Joined: 21 Jun 2004 Posts: 48 Location: Heaven
|
|
|
|
hi,
To code JCL for the given below condition,
1. my input file contains customer id,quantity and price as the fields
with 200 records(not sorted)...
2. my output should contain 2 files....
3. 1st file's output should be top 50 records in accordance with
sorted quantity
4. 2nd file output should be top 50 records in accordance with the
sorted price. |
|
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 Location: Milan, Italy
|
|
|
|
You can use the DFSORT/ICETOOL utitily as you can see below:
| Code: |
//STEP030S EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INP1 DD DISP=SHR,DSN=INPUT
//OUT1 DD DISP=(,PASS),
// UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),
// DSN=&&OUT1
//OUT2 DD DISP=(,PASS),
// UNIT=SYSDA,SPACE=(CYL,(10,10),RLSE),
// DSN=&&OUT2
//TOOLIN DD *
SORT FROM(INP1) USING(CTL1)
SORT FROM(INP1) USING(CTL2)
//CTL1CNTL DD *
SORT FIELDS=(quantity,A)
OUTFIL FNAMES=OUT1,ENDREC=50
//CTL2CNTL DD *
SORT FIELDS=(price,A)
OUTFIL FNAMES=OUT2,ENDREC=50
/*
|
|
|