|
View previous topic :: View next topic
|
| Author |
Message |
Furor
New User
Joined: 04 Jun 2009 Posts: 30 Location: Bangalore
|
|
|
|
Hi,
I have to split the files on the account numbers and sort them on a Key.
Will performing both in the same sort card will be faster or doing it seperately OUTFIL.
1st Scenario :
Step A
| Code: |
SORT FIELDS=COPY
OUTFIL INCLUDE=(8,2,CH,LT,C'123),FNAMES=SORTOF1
OUTFIL INCLUDE=(8,2,CH,GE,C'123',AND,8,2,CH,LT,C'456'),FNAMES=SORTOF2
and so on |
Step B
| Code: |
| Apply SORT FIELDS=(122,4,CH,A) to SORTOF1 , SORTOF2 and so on |
2nd Scenario:Using only one step
| Code: |
SORT FIELDS=(122,4,CH,A)
OUTFIL INCLUDE=(8,2,CH,LT,C'123),FNAMES=SORTOF1
OUTFIL INCLUDE=(8,2,CH,GE,C'123',AND,8,2,CH,LT,C'456'),FNAMES=SORTOF2
and so on |
I don't have access to Mainframes therefore I cannot test myself.
The records will be in millions.
Thanks |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
First of all, Some syntax errors are around your sortcards. Like missing '
Also you are trying to compare 2 byte character with 3 byte data ('123' ). Is it intentional?
Anyways... Approach should be..
1: Filter with common include\omit criteria among all outfils
2: sort with keys
3: Use outfil with appropriate additional include\omit condition |
|
| Back to top |
|
 |
Furor
New User
Joined: 04 Jun 2009 Posts: 30 Location: Bangalore
|
|
|
|
Thanks, I was just trying to put up a scenario... though with not too accurate examples...
In short you suggest to split the process and not to go for a single step which includes both the sort and the include...Any specifc reason for this. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
am asking to do all 3 things I suggested in one step.
Below is sample example explaining it.
| Code: |
//S1 EXEC PGM=SORT
//SORTIN DD *
AAA BBB 111 Y
GGG HHH 444
CCC DDD 222
III JJJ 555
EEE FFF 333
GGG HHH 444 Y
III JJJ 555 Y
//F1 DD SYSOUT=*
//F2 DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OMIT COND=(13,3,ZD,GE,500) FILTER RECORDS GE 500
SORT FIELDS=(13,3,ZD,A) SORT RECORDS BASED ON KEY
OUTFIL FNAMES=F1,INCLUDE=(20,1,CH,EQ,C'Y') RECORDS WITH Y FLAG
* AND KEY GE 500
OUTFIL FNAMES=F1,SAVE RECORDS WITH NO Y FLAG
* AND KEY GE 500
/*
|
|
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Opps both outfile names are F1 change second to F2
| Code: |
//SYSIN DD *
OMIT COND=(13,3,ZD,GE,500) FILTER RECORDS GE 500
SORT FIELDS=(13,3,ZD,A) SORT RECORDS BASED ON KEY
OUTFIL FNAMES=F1,INCLUDE=(20,1,CH,EQ,C'Y') RECORDS WITH Y FLAG
* AND KEY GE 500
OUTFIL FNAMES=F2,SAVE RECORDS WITH NO Y FLAG
* AND KEY GE 500
/*
|
|
|
| Back to top |
|
 |
Furor
New User
Joined: 04 Jun 2009 Posts: 30 Location: Bangalore
|
|
|
|
Sambhaji, thanks for taking your time out.
As I said in the very begning about the 2nd approach :
| Quote: |
| 2nd Scenario:Using only one step |
I just wanted to know if this would take less CPU time then the first approach. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Passing the entire input file once is usually (almost always) faster than passing the data twice.
Why is cpu time mentioned? |
|
| Back to top |
|
 |
Furor
New User
Joined: 04 Jun 2009 Posts: 30 Location: Bangalore
|
|
|
|
Thanks Dick and Sambhaji.
It should have been mentioned as the job execution time.
Have a Pleasant day/ night ahead. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|