Add Numeric Values Using 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
venky
Active Member
Posts: 50
Joined: Sat May 12, 2012 10:13 pm

Add Numeric Values Using JCL

Post by venky » Fri Apr 08, 2016 7:39 pm

Hi All,

Can anyone please look into the below question.

I have a 80 byte file with the below records.

164 NUMS:000001
123 NUMS:000001
122 NUMS:000001
223 NUMS:000001
444 NUMS:000001

Need output as below.


164 NUMS:000001
123 NUMS:000001
122 NUMS:000001
223 NUMS:000001
444 NUMS:000001
SUM :000005

When I am trying to use as below

SORT FIELDS=(005,04,CH,A),EQUALS
SUM FIELDS=(10,6,ZD)

but i am getting the output as.

164 NUMS:000005

Thank you.

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

Post by William Collins » Sat Apr 09, 2016 12:32 pm

Why do you want to SORT the data which is already in the order you want?

Look at OUTFIL reporting features: REMOVECC, SECTIONS with TRAILER3 using TOT/TOTAL. You can format the data in many ways like that.

As well as sucking-up resources and consolidating data, SUM has no options for formatting.

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