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

Optimising sortcard

IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message

Active User

Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Thu May 24, 2018 6:25 pm
Reply with quote

Hi All,
Could someone please help us in optimizing one of the sortcard. The system is using syncsort version SYNCSORT FOR Z/OS 2.1.2.

About the sortcard:
This sortcard is using an input file and splitting it into 5 different files depending upon some include conditions. Currently it is processing around 300 million records in input and usually takes 18 minute of cpu tcb.

Could you please help us in providing some suggestion so that the CPU time can reduce.

The code looks like below:


  OPTION COPY                                                         
  OUTFIL FNAMES=SORT01,INCLUDE=((5,4,SS,EQ,C'0008,0013,0015,0017'),   
  OUTFIL FNAMES=SORT02,INCLUDE=((5,4,SS,EQ,C'0006,0009,0018,0029'),   
  OUTFIL FNAMES=SORT03,INCLUDE=((5,4,SS,EQ,C'0012,0025,0052,0084'),   
  OUTFIL FNAMES=SORT04,INCLUDE=((5,4,SS,EQ,C'0051'))                   
  OUTFIL FNAMES=SORT05,INCLUDE=((5,4,SS,NE,C'0008,0013,0015,0017'),   

Back to top
View user's profile Send private message

Active Member

Joined: 29 Apr 2008
Posts: 962
Location: Maryland

PostPosted: Fri May 25, 2018 5:18 am
Reply with quote

There is no time-consuming operation in this example which might seriously affect the total CPU time spent by SORT utility.

Only one minor improvement can be suggested: eliminate OR/AND operators, and use single "SS,EQ", or "SS,NE" for the whole list of valid/invalid selection values. But I'm in doubt if it might improve total performance by more than 1-2%; the major time-consuming operations are: read/write 300B records, and moving data between I/O buffers, and temporary memory storage.

Keep in mind the rule from SORT manual:
If the control statement does contain a literal string that would extend beyond column 71, place a continuation character in column 72 and begin the continuation of the literal string in column 16 of the next card image.
Back to top
View user's profile Send private message
Arun Raj


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 25, 2018 11:12 pm
Reply with quote

The substring comparison format you have used above would compare the field against each possible 4 byte strings.

For example,
would look for

.....and so on. So you might be doing a lot more checks than that are actually required.

I dont have Syncsort and can't test this, but I would suggest you try modifying this into individual ORs instead of a substring SS search and see if that improves anything.

In order to simplify the multiple EQ/ORs, you can use the below format if your Syncsort version supports it.

Similarly multiple NE/ANDs can be simplified as
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 -> SYNCSORT


Similar Topics
Topic Forum Replies
No new posts Reformat clause in joinkeys sortcard ... DFSORT/ICETOOL 2
No new posts Sortcard to put comma after particula... DFSORT/ICETOOL 21
No new posts comparing file using sortcard with th... DFSORT/ICETOOL 3
No new posts Need help for the sortcard using outr... JCL & VSAM 15
No new posts Need Sortcard for filtering records u... JCL & VSAM 10
Search our Forums:

Back to Top