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
 

 

Applying a calculation to a summed value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Mon Sep 17, 2012 7:48 pm    Post subject: Reply to: Sum and Avg for the records.
Reply with quote

Code:

Sec  trans
01    10
02    20
03    30
04    40
05    50

lets assume the above data in the DSN.i want to calculated the average for Second by using this logic.

Total of trans/ 24*60*60 = Second average.
EX: Here 150/24*60*60 =0.0001

Kindly let me know how to use the above logic in JCL.. Pls help me out.
Back to top
View user's profile Send private message

shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Mon Sep 17, 2012 8:36 pm    Post subject:
Reply with quote

Hello enrico-sorichetti,

Pls help me out.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 17, 2012 8:50 pm    Post subject:
Reply with quote

ennnrriiicoooo where are you?
i can't get my paycheck this week until you have done my work for me.
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Mon Sep 17, 2012 8:53 pm    Post subject:
Reply with quote

icon_cry.gif .. stop kidding guys... i am helpless.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 17, 2012 8:58 pm    Post subject:
Reply with quote

i was not kidding!

and enrico,
he is sitting there at his desk waiting patiently (maybe not)
for your solution to his problem.
Back to top
View user's profile Send private message
shanth555

New User


Joined: 17 Aug 2012
Posts: 35
Location: India

PostPosted: Mon Sep 17, 2012 9:04 pm    Post subject:
Reply with quote

i think enrico is busy with some other work.

and dbzTHEdinosauer,

Do u have any idea about my logic?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Mon Sep 17, 2012 9:59 pm    Post subject: Reply to: Applying a calculation to a summed value
Reply with quote

You have to check in you manual/search the forum for things like DIV (divide) and do the calculation on OUTREC/OUTFIL by which time you'll have the SUMmed value,
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Sep 17, 2012 10:56 pm    Post subject: Reply to: Applying a calculation to a summed value
Reply with quote

a bit of ingenuity please ...
it should not have been to hard to imagine something along the lines of
Code:

 000005 //ICE     EXEC PGM=SORT
 000006 //SYSPRINT  DD SYSOUT=*
 000007 //SYSOUT    DD SYSOUT=*
 000008 //*4567890123456
 000009 //SORTIN    DD *
 000010 01       1
 000011 02      12
 000012 03     123
 000013 04    1234
 000014 05   12345
 000015 06   23456
 000016 07   34567
 000017 08   45678
 000018 09   56789
 000019 10   67890
 000020 //SORTOUT   DD SYSOUT=*
 000021 //SYSIN     DD *
 000022   OPTION COPY
 000023   INREC OVERLAY=(081:3,8,UFF,MUL,+100000,M11,LENGTH=20,
 000024                  101:(3,8,UFF,MUL,+100000),DIV,+84600,M11,LENGTH=20)
 000025   OUTFIL REMOVECC,NODETAIL,
 000026   TRAILER1=('COUNT : ',COUNT=(M11,LENGTH=08),/,
 000027             'SUM   : ',TOT=(081,20,UFF,EDIT=(TTTTTTTT.TTTTT)),/,
 000028             'AVG   : ',AVG=(081,20,UFF,EDIT=(TTTTTTTT.TTTTT)),/,
 000029             'XSEC  : ',TOT=(101,20,UFF,EDIT=(TTTTTTTT.TTTTT)))


to get
Code:

COUNT : 00000010
SUM   : 00242095.00000
AVG   : 00024209.50000
XSEC  : 00000002.86160
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 MSU calculation for DB2 (to decide be... SRICOBSAS DB2 4 Wed Mar 23, 2016 6:07 pm
No new posts Applying DB2 V 10.1 PTF. Manshadi DB2 14 Tue Feb 23, 2016 5:19 pm
No new posts Time difference calculation Ramsee COBOL Programming 8 Wed Dec 10, 2014 3:15 pm
No new posts Date calculation thru SORT card. bshkris SYNCSORT 3 Tue Jul 08, 2014 1:56 pm
No new posts Applying compound condition karthickpearl DFSORT/ICETOOL 8 Fri Apr 11, 2014 6:28 pm


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