Rg: how to sumup in jcl?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Rg: how to sumup in jcl?

Postby kandrepavan » Tue Dec 11, 2012 10:51 am

Hi all,

i want to sum the values of the following data.
Data format is HTNNO mark1 mark2
//TCHN635$ JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=B,
// REGION=5M,NOTIFY=&SYSUID,TIME=(5,0)
//STEP01 EXEC PGM=SORT
//SORTIN DD *
12346 34 35
12347 34 35
12348 34 35
12349 34 35
/*
//sortout dd sysout=*
//sysprint dd sysout=*

i need the output as , output data format :
htno m1 m2 total
12346 34 35 69
12347 34 35 69
12348 34 35 69
12349 34 35 69

and one more question is how to know which version of sort we are using ?
kandrepavan
 
Posts: 35
Joined: Wed Mar 21, 2012 11:03 am
Has thanked: 0 time
Been thanked: 1 time

Re: Rg: how to sumup in jcl?

 

Re: Rg: how to sumup in jcl?

Postby enrico-sorichetti » Tue Dec 11, 2012 1:20 pm

use the code tags to make Your JCL/DATA more readable
it' s a due courtesy to the people willing to spend time helping You

without code tags is what You posted

with the code tags
//TCHN635$ JOB MSGCLASS=X,MSGLEVEL=(1,1),CLASS=B,
// REGION=5M,NOTIFY=&SYSUID,TIME=(5,0)
//STEP01 EXEC PGM=SORT
//SORTIN DD *
12346 34 35
12347 34 35
12348 34 35
12349 34 35
/*
//sortout dd sysout=*
//sysprint dd sysout=*


htno m1 m2 total
12346 34 35 69
12347 34 35 69
12348 34 35 69
12349 34 35 69
 


if You click on the
DFSORT/ICETOOL/ICEGENER link at the top of the page
dfsort-icetool-icegener/

the second topic will tell all about the DFSORT levels and relative services
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Rg: how to sumup in jcl?

Postby NicC » Tue Dec 11, 2012 2:24 pm

Why JCL in the title? JCL cannot 'sumup'. You have posted in the DFSORT part of the forum so I presume you want DFSORT to do the summing up. You will, probably, use JCL to run the DFSORT process but it has nothing to do with your problem.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Rg: how to sumup in jcl?

Postby BillyBoyo » Tue Dec 11, 2012 4:41 pm

If you want to add fields on a record, look at your documentation for ADD and the other mathematical things available.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Rg: how to sumup in jcl?

Postby skolusu » Tue Dec 11, 2012 11:10 pm

kandrepavan,

Use the following DFSORT JCL which will give you the desired results
//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
----+----1----+----2----+----3----+----4----+----5-
12346 34 35                                       
12347 34 35                                       
12348 34 35                                       
12349 34 35                                       
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                   
  OPTION COPY                                     
  INREC OVERLAY=(13:7,2,ZD,ADD,10,2,ZD,EDIT=(IIT))
//*


The output from this job is
12346 34 35  69
12347 34 35  69
12348 34 35  69
12349 34 35  69
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post