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

Combining two sort cards


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Sat Nov 24, 2012 3:44 am
Reply with quote

Hi,

Can we put some effective logic to combine the below SORT Cards to avoid redundancy and improve maintainability. May be use SYMBOLS.

The difference between the 2 SORT Cards are highlighted in RED.

SORT CARD 1: -
SORT FIELDS=(1,22,CH,A)
OMIT COND=(1,3,CH,EQ,C'999')
OUTREC FIELDS=(1:1,3,
4:4,19,
23:23,3,
26:48,19,
45:109,3,
48:115,3,
51:118,19,
70:137,1,
.
.
.
1501:C'22')
There are around 1000 such fields mentioned in the OUTREC and in the end we append 22.

SORT CARD 2: -
SORT FIELDS=(1,22,CH,A)
OMIT COND=(1,3,CH,EQ,C'000',OR,1,3,CH,EQ,C'999')OUTREC FIELDS=(1:1,3,
4:4,19,
23:23,3,
26:48,19,
45:109,3,
48:115,3,
51:118,19,
70:137,1,
.
.
.
.
.
.
1501:C'11')
There are around 1000 such fields mentioned in the OUTREC (which is exactly same as that of SORT CARD 1) and in the end we append 11.

Thanks,
Indrajit
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Sat Nov 24, 2012 11:36 am
Reply with quote

Why need to combine both the sort cards ?

Dont you see both the cards performs different functions and even if you wanted to build them dynamically each time you need to understand that even to make use of symbols you need a code to generate each time
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat Nov 24, 2012 3:55 pm
Reply with quote

Possibly, you can use SYMNAMES but 1000 conditions sound little too much. If that many sub-combinations from input are needed, why not try to write the input file in required order at first place.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Nov 24, 2012 6:19 pm
Reply with quote

Code:
SORT FIELDS=(1,22,CH,A)     
OMIT COND=(1,3,CH,EQ,C'999')
OUTREC FIELDS=(1:1,3,       
               4:4,19,       
              23:23,3,       
              26:48,19,     
              45:109,3,     
              48:115,3,     
              51:118,19,     
              70:137,1,     
.
.
.
            1501:C'22')


I'd start with this:

Code:
  OMIT COND=(1,3,CH,EQ,C'999')
  INREC BUILD=(1,3,       
               4,19,       
              23,3,       
              48,19,     
              109,3,     
              115,3,     
              118,19,     
              137,1,     
.
.
.
            C'22')
  SORT FIELDS=(1,22,CH,A)     


On the assumption that all the rearrangement is making the record smaller, do the new record on INREC, so less data goes into the SORT, so the sort will be faster.

Drop all the columns, which will vastly improve maintainability. As arranged above, all the data fields follow on one from anoher, which is, from what you showed, what was happening by you meticulously specifying the columns.

Definitely symbols/SYMNAMES. You can define a constant for the value you suffix to each record, have a PDS/PDSE member for the "record layout" and concatenate a different member for "constants" for each file. You could use symbols for the OMIT which would allow the identical sort card for both steps. It would be possible, assuming your DFSORT is reasonably up-to-date, to process both files at once, if you felt there was genuine benefit in that.

However, Anuj makes a good point. Why so much re-arranging of the data? If your records were created how you want, you'd not be left much to do (appending the value). If subsequent programs could be changed to use the record-layout as created, you get a similar outcome. So, why can't you do either of those?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Tue Nov 27, 2012 9:35 am
Reply with quote

Thanks for the inputs.

As suggested, I have created one input file with the required data and I am just doing the comparison. So I have got rid of the redundant outrec coded in two SORT Cards.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Nov 27, 2012 3:20 pm
Reply with quote

OK. Thanks for letting us know. Where topics are related, it would be good to indicate. It may have saved people time and effort not to have looked at this one much.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Nov 27, 2012 6:09 pm
Reply with quote

I agree with Bill, that does help.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
Search our Forums:

Back to Top