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
 

 

What is WHEN-COMPILED

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

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Fri May 05, 2006 12:30 pm    Post subject: What is WHEN-COMPILED
Reply with quote

Hi friends,
In a cobol program I found this satement, this is used to move the program compiled date and time to a working storage variable.
it looks like WHEN-COMPILED is a reserved word(WHEN-COMPILED is not at all defined any where in the program). Can anyone tell me how this works.

MOVE WHEN-COMPILED TO WS-CMPL-DATE-TIME


defenition of WS var:
10 WS-CMPL-DATE-TIME
15 WS-CMPL-CCYYMMDD X(8).
15 WS-CMPL-TIME X(8).


Thanks in advance
Venkat
Back to top
View user's profile Send private message

muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Fri May 05, 2006 12:52 pm    Post subject:
Reply with quote

Venkat,

This is what i got in one of the manuals.


x The WHEN-COMPILED special register contains the date at the start of the compilation. WHEN-COMPILED is an alphanumeric data item with the implicit definition:

01 WHEN-COMPILED GLOBAL PICTURE X(16) USAGE

DISPLAY

x The WHEN-COMPILED special register has the format:

MM/DD/YYhh.mm.ss (MONTH/DAY/YEARhour.minute.second)

x For example, if compilation began at 2:04 PM on 27 April 1995, WHEN-COMPILED would contain the value 04/27/9514.04.00.

x WHEN-COMPILED can only be used as the sending field in a MOVE statement.

x WHEN-COMPILED special register data cannot be reference-modified.


Regards,
Muthuvel.
Back to top
View user's profile Send private message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Fri May 05, 2006 1:02 pm    Post subject: Re: WHEN-COMPILED
Reply with quote

Hi Muthuvel,
Thanks for the information.
I want to know two more things:
1. Is this register maintained separately for every COBOL program ?
2. If your answer is YES to first question, than for how long this information will be stored in that register?

Thanks
Venkat
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri May 05, 2006 11:22 pm    Post subject: Re: What is WHEN-COMPILED
Reply with quote

venktv,

Quote:

1. Is this register maintained separately for every COBOL program ?
2. If your answer is YES to first question, than for how long this information will be stored in that register?


This is not a hardware resister, but a COBOL software register. The date and time the program was compiled is stored in the OBJECT module and loaded into the WHEN_COMPILED register when the program is entered. The LOAD module may contain several OBJECT modules, each with it?s own WHEN-COMPILED date/time. When you call a subroutine the date/time the subroutine was compiled is in the WHEN-COMPILED register. Each program, in effect, has it?s own WHEN-COMPILED register that exists only while the program is being executed.

One of the things that can be done with this register is to print the date/time the program was compiled on reports as an indication of what version of the program was running.

One of the things I like to do, is the first time a subroutine is called (only once per program) display the date time the subroutine was compiled. Sometimes with a complex development/migration/implementation system it?s hard to know what version of subroutines really got executed with your program.


Code:


 01  WHEN-COMPILED-WORK.                                         
      03  COMPILE-DATE            PIC X(8)       VALUE 'MM/DD/YY'.
      03  COMPILE-TIME            PIC X(8)       VALUE 'HH.MM.SS'.
 
      MOVE WHEN-COMPILED          TO WHEN-COMPILED-WORK.       
      MOVE COMPILE-DATE           TO REPORT-DATE-PROGRAM-COMPILED.
      MOVE COMPILE-TIME           TO REPORT-TIME-PROGRAM-COMPILED.



Dave
Back to top
View user's profile Send private message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Mon May 08, 2006 11:42 am    Post subject: Re: What is WHEN-COMPILED
Reply with quote

Thanks Dave.
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 About compiled REXX (OORexx) chaoj CLIST & REXX 3 Wed Jul 08, 2015 2:26 pm
No new posts Can a compiled COBOL program be rever... boyti ko COBOL Programming 2 Wed Dec 03, 2014 1:12 pm
No new posts Who compiled the Cobol load module parsesource TSO/ISPF 11 Thu Mar 03, 2011 11:07 pm
No new posts How to findout compiled source? enrico-sorichetti COBOL Programming 4 Thu Jun 24, 2010 7:06 pm
No new posts Wil thre b any BIND if we change in c... samimaktar Mainframe Interview Questions 2 Fri Oct 30, 2009 3:03 am


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