IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Applying a calculation to a summed value


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Sep 17, 2012 9:59 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Mon Sep 17, 2012 10:56 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Allocated space calculation from DCOL... PL/I & Assembler 3
No new posts VSAM file Storage Calculation JCL & VSAM 3
No new posts MSU calculation for DB2 (to decide be... DB2 4
No new posts Applying DB2 V 10.1 PTF. DB2 14
Search our Forums:

Back to Top