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
 

 

Combining two sort cards

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Combining two sort cards
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

Moderator


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

PostPosted: Sat Nov 24, 2012 11:36 am    Post subject:
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

Senior Member


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

PostPosted: Sat Nov 24, 2012 3:55 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Sat Nov 24, 2012 6:19 pm    Post subject: Re: Combining two sort cards
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7233

PostPosted: Tue Nov 27, 2012 3:20 pm    Post subject: Reply to: Combining two sort cards
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

Senior Member


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

PostPosted: Tue Nov 27, 2012 6:09 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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