Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Indrajit_57
Warnings : 1

New User

Joined: 27 Jun 2006
Posts: 60

 Posted: Sat Nov 24, 2012 3:44 am    Post subject: Combining two sort cards 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

Pandora-Box

Moderator

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

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

Senior Member

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

 Posted: Sat Nov 24, 2012 3:55 pm    Post subject: 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.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

Posted: Sat Nov 24, 2012 6:19 pm    Post subject: Re: Combining two sort cards

 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')

 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?
Indrajit_57
Warnings : 1

New User

Joined: 27 Jun 2006
Posts: 60

 Posted: Tue Nov 27, 2012 9:35 am    Post subject: 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.
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

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

Senior Member

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

 Posted: Tue Nov 27, 2012 6:09 pm    Post subject: I agree with Bill, that does help.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Build SQL query using SORT balaji81_k DFSORT/ICETOOL 17 Mon Feb 18, 2019 9:56 am Build Dynamic Sort output and limit '... balaji81_k DFSORT/ICETOOL 3 Sat Feb 02, 2019 4:40 am PARAMETER 'F1' IS UNIDENTIFIED error ... Poha Eater DFSORT/ICETOOL 14 Fri Feb 01, 2019 2:39 pm SORT INNER JOIN [F1] OUT OF SEQ ERROR balaji81_k DFSORT/ICETOOL 8 Wed Jan 30, 2019 3:21 am Dates compare on specific dates using... balaji81_k DFSORT/ICETOOL 2 Thu Jan 24, 2019 12:03 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us