Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using Sort and Outfil together

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Using Sort and Outfil together
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    Post subject:
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    Post subject: Reply to: Using Sort and Outfil together
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Using Sort and Outfil together
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

Site Director


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

PostPosted: Wed Apr 21, 2010 8:33 pm    Post subject:
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    Post subject: Reply to: Using Sort and Outfil together
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us