View previous topic :: View next topic
|
Author |
Message |
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
Using the z/OS XL C compiler. I would like to have a time stamp included the the generated object code. I know how to do it in Assembler and I believe that there is a way in Java but I cannot seem to find anything in C. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2589 Location: Silicon Valley
|
|
|
|
You probably want the time that it was compiled. I could not find that either, but there is a macro variable __timestamp__ which provides a date based on the last change date of the source. See chapter 19 of the Language Reference. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2126 Location: USA
|
|
|
|
You could use __DATE__ and __TIME__. |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
Thank you all for the replies. Unfortunately, none solved my problem.
However, I did look in the object code generated and I see the following right after the XSD for main:
XSD f main
TXT 20230924153257020400 = |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2126 Location: USA
|
|
|
|
What is any relation between C language & object code, and Java & MQSeries - ???
And what exactly so called "your problem" is??? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2589 Location: Silicon Valley
|
|
|
|
You were not clear in showing what you tried but that did not work. Isn't it just something like this?
Code: |
const char tstamp = __date__ + __time__; |
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1319 Location: Bamberg, Germany
|
|
|
|
Pedro wrote: |
You were not clear in showing what you tried but that did not work. Isn't it just something like this?
Code: |
const char tstamp = __date__ + __time__; |
|
STFW found:
Code: |
const char *datetime_str = __DATE__ " " __TIME__; |
|
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
I am trying to get a compile date and time into the object code. If an end user reports a problem, I want to know if they have the most recent version.
Again, thanks to everyone for the information provided. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2126 Location: USA
|
|
|
|
Grant Goodale wrote: |
I am trying to get a compile date and time into the object code. If an end user reports a problem, I want to know if they have the most recent version.
Again, thanks to everyone for the information provided. |
You've received several explicit examples how to do what you want.
But you continue repeating your mantra: "Unfortunately, none solved my problem" |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2589 Location: Silicon Valley
|
|
|
|
re: "trying to get a compile date and time into the object code."
When I was at IBM, it was not the compile time that was important, but the APAR number string. We just kept appending the most recent APAR number at the end of a constant. Any defined constants will appear in the OBJ file and load module.
Sort of like this:
Code: |
const char APAR_str = "APAR: P10001 P10002 P10003"; |
When the string got too long, we removed the oldest number.
You probably do not have APARs, but perhaps you can use some number from your problem tracking program. Or even just a short blurb describing the most recent change. |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
Pedro, thanks. You have raised a good point. |
|
Back to top |
|
|
|