IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using Sort and Outfil together


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Furor

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Wed Apr 21, 2010 2:32 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 21, 2010 3:12 pm
Reply with quote

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
View user's profile Send private message
Furor

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Wed Apr 21, 2010 3:26 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 21, 2010 3:36 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 21, 2010 3:50 pm
Reply with quote

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
View user's profile Send private message
Furor

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Wed Apr 21, 2010 7:41 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 21, 2010 8:33 pm
Reply with quote

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
View user's profile Send private message
Furor

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Thu Apr 22, 2010 8:05 am
Reply with quote

Thanks Dick and Sambhaji.
It should have been mentioned as the job execution time.

Have a Pleasant day/ night ahead.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top