Need to merge two sort steps to reduce redundancy in JCL

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
balu.jonty
Member
Posts: 1
Joined: Fri Jan 25, 2013 11:55 am

Need to merge two sort steps to reduce redundancy in JCL

Post by balu.jonty » Fri Jan 25, 2013 12:07 pm

I am having two sort cards. In I/P file 309 position account number is there. AFter first sort step it moved to 314 position. Again one more sort cord used to sort based on account number. ( after formating).

I planned to merge both steps to reduce redundancy. Instead of outrec i used inrec and sorted based on 314,23 position. Because first it formats the records by using inrec. AFter inrec the account number will be available in 314 position. after that sorting the records based on acc.number. The job is running sucessfully and i compared the results.
Some records are varing. Data is not matching.
1St sort card:

SORT FIELDS=COPY
OUTREC FIELDS=(1:1,302,
303:338,5,
308:303,35,
343:C'1',
554:343,35,
650:C'00001')
END

and


SORT FIELDS=(314,23,CH,A),
DYNALLOC=(SYSDA,199)
END


I merged both, job ran fine. i comared O/p files. Few records are varing. I not able to find the exact reason. Can any one help me.

MEGER card:

SORT FIELDS=(314,23,CH,A),
DYNALLOC=(SYSDA,199)
INREC FIELDS=(1:1,302,
303:338,5,
308:303,35,
343:C'1',
554:343,35,
650:C'00001')
END
Last edited by balu.jonty on Sat Jan 26, 2013 11:56 am, edited 1 time in total.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Jan 25, 2013 10:21 pm

I planned to merge both steps to reduce redundancy.
There is probably no reason to try and combine these. . .

Having a few more bits of JCL and sort control is basically free.
Have a good one

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Mon Jan 28, 2013 4:36 pm

I don't think that you'll save a whole lot of CPU or will be able to do some MIPS balancing with that merge; however, what difference/s do you observe in two output files?

Did you check the statistics in SYSOUT for Record-in and out - for both the SORTs?
Regards,
Anuj

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Jan 28, 2013 5:54 pm

Code: Select all

    INREC  BUILD=(1,302, 
                  338,5, 
                  303,35, 
                  C'1', 
                  554:343,35, 
                  650:C'00001') 
                                
    SORT FIELDS=(314,23,CH,A), 
            DYNALLOC=(SYSDA,199)

I've used BUILD instead of the ageing and overloaded FIELDS. There is no reason that this should not "work".

However, since you didn't exactly say what was wrong, it is pointless guessing. You are, by specifying non-contiguous columns, leaving large "gaps" in your records.

Judging by your DYNALLOC you have enormous datasets. Yes, there will be considerable saving (CPU, elapsed, EXCP) from combining the steps, but to do so, you need the correct output.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others