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
 

 

query to know thow to cal. average time from sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Thu May 24, 2007 4:47 pm    Post subject: query to know thow to cal. average time from sequential file
Reply with quote

Hi
Is there any utility or a way to take a average of time of n number of Records from a sequential file input time will be given in HHMMSS
and avg time should be also in HHMMSS
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 24, 2007 8:57 pm    Post subject:
Reply with quote

Hello and welcome to the forums,

The amount of time will depend on many factors - how many jobs are running in the system, how busy the i/o and cpu, how long the records are and how they are blocked, any access to vsam or database info in the run unit.

If you want to run a very simple benchmark, create your job that will read some number of records (say 5 million) and run it several times at different times of the day/night. After the "open" and before the "close" get the date and times and write them into a file that you MOD onto each run. You could also capture the date/time before the open and after the close to see how much time that takes - it is your statistics file, so you can include whatever you want. After you've run a number of tests, you can analyze the file you've created with your elapsed times.

We're here when there are questions.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu May 24, 2007 9:06 pm    Post subject:
Reply with quote

Dick,
I think you overestimated the question. icon_lol.gif
As per my understanding OP wants to add time records(Records with HHMMSS format) and divide it by count of (time records)..
I was confused at first but when I read second line 3 times, I stopped thinking on it..
Correct me if I am wrong..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 24, 2007 10:05 pm    Post subject:
Reply with quote

Hi Abhijit,

I surely wouldn't say that you are wrong. . . I believe that we still trying to understand the request. . . My understanding is definitely not complete.

I'm confused as to how dividing some "time value" by the number/count of time records yields a meaningful result.

Maybe jaspal will provide some clarification. Some sort of example(s) would be most helpful.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 24, 2007 10:18 pm    Post subject:
Reply with quote

Agreeing with Abhijit, I'm reading it a the average elapsed times from various records.....
Back to top
View user's profile Send private message
jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Fri May 25, 2007 10:58 am    Post subject: Re: query to know thow to cal. average time from sequential
Reply with quote

HI ALL

Agkshirsagar got it
i'll explain by an example

lets have a sequential file with 500 records

SUB-ID ACQ-PROC PROCESS-TIME
1) 111110 10000001 10:10:40
2) 111111 10000001 10:11:36

I M CONSIDERING TWO RECORDS

AS I HAVE DECLARED THE ARRAY AND WILL MOVE SUB-ID,ACQ-PROC ,PROCESS-TIME AND OTHER REQUIRED FIELDS
NOW I HAVE TO TAKE AN AVERAGE AND MOVE IT TO WORKING STORAGE VARIABLES

AVG SHOULD BE 10:11:08

REGARDS,
JASPAL
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri May 25, 2007 12:07 pm    Post subject: Re: query to know thow to cal. average time from sequential
Reply with quote

Below code will work for averaging 2 times, I have tried to give you the
logic, change it as per your requirement. I really don't know if there are any intrinsic functions for 'time' in COBOL.
Code:
       IDENTIFICATION DIVISION.               
       PROGRAM-ID. TESTPROG.                 
       ENVIRONMENT DIVISION.                 
       DATA DIVISION.                         
       WORKING-STORAGE SECTION.               
       01 TIME-VAR1 VALUE '101040'.           
          05 HR1 PIC 99.                     
          05 MI1 PIC 99.                     
          05 SE1 PIC 99.                     
       01 TIME-VAR2 VALUE '101136'.           
          05 HR2 PIC 99.                     
          05 MI2 PIC 99.                     
          05 SE2 PIC 99.                     
       01 AVG-TIME VALUE '000000000'.         
          05 HR3 PIC 999.                     
          05 MI3 PIC 999.                     
          05 SE3 PIC 999.                     
       01 TEMP PIC 99.                       
        PROCEDURE DIVISION.                                 
             COMPUTE SE3 = SE1 + SE2.                       
             IF SE3 > 60                                     
               MOVE 0 TO TEMP                               
               DIVIDE SE3 BY 60 GIVING TEMP REMAINDER SE3   
               ADD TEMP TO MI3                               
             COMPUTE MI3 = MI1 + MI2 + MI3                   
             IF MI3 > 60                                     
               MOVE 0 TO TEMP                               
               DIVIDE MI3 BY 60 GIVING TEMP REMAINDER MI3   
               ADD TEMP TO HR3                               
             END-IF.                                         
             COMPUTE HR3 = HR1 + HR2 + HR3                   
             COMPUTE HR3 = HR3 / 2                           
             COMPUTE MI3 = MI3 / 2                           
             COMPUTE SE3 = SE3 /2                           
             DISPLAY HR3 ':' MI3 ':' SE3
when I run the program it gave me 010:011:008.

[/code]
Back to top
View user's profile Send private message
jaspal

New User


Joined: 22 May 2007
Posts: 68
Location: mumbai

PostPosted: Fri May 25, 2007 3:35 pm    Post subject: Re: query to know thow to cal. average time from sequential
Reply with quote

thanks Agkshirsagar
i'll try if it serves my problem
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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