Michel,
   Odd. Yes, I'm running IBM C. Also 1.8. You should probably open
an ETR. Perhaps your installation is in error.

> Hi Don,
> 
> As I told in my first posting:
> In batch & AMODE 31, the following program works fine:
> 
> #include <time.h>                /* for date and time functions */
> #include <stdio.h>               /* for printf()                */
> 
> int main(void)
> {
>     time_t     ctime;
>     struct tm *ptr_to_struct;
> 
>     ctime = 0;            /* retrieve the UNIX epoch            */
>     ptr_to_struct = gmtime(&ctime);
>     printf("\"(1) %s\"", asctime(ptr_to_struct));
>     ctime = time(NULL);   /* retrieve the current calendar time */
>     ptr_to_struct = localtime(&ctime);
>     printf("\"(2) %s\"", asctime(ptr_to_struct));
>     return 0;
> }
> 
> In batch & AMODE 31, printf() displays:
> --------------------------------------
> "(1) Thu Jan  1 00:00:00 1970
> ""(2) Mon May  7 14:38:10 2007
> "
> (O.K. because asktime() returns a string which includes NL)
> 
> In batch & AMODE 64, the result is:
> ----------------------------------
> "(1) Thu Jan  1 00:00:00 1970
> followed by:
> IEF450I ARCIS1X GO STEP1 - ABEND=S000 U4087 REASON=00000007
> i.e. calling gmtime() is successful but the call of time() fails.
> 
> Since you compiled and executed your program in USS, I now performed the
> following tests:
> 
> In UNIX & AMODE 31:
> ------------------
> IBMUSER:/u/arcis: >c99 -o timepgm time.c
> IBMUSER:/u/arcis: >timepgm
> "(1) Thu Jan  1 00:00:00 1970
> ""(2) Mon May  7 07:49:44 2007
> "IBMUSER:/u/arcis: >
> (O.K.)
> 
> BUT in UNIX & AMODE 64:
> ----------------------
> IBMUSER:/u/arcis: >c99 -Wc,LP64 -Wl,LP64 -o timepgm time.c
> IBMUSER:/u/arcis: >timepgm
> 
>   83951656      Killed  ./timepgm
> IBMUSER:/u/arcis: >
> i.e. even worse than in batch!
> There is no single printf() output!
> 
> Just to be sure, I added #define __Posix1a in time.c, but the result is the
> same:
> IBMUSER:/u/arcis: >oedit time.c
> IBMUSER:/u/arcis: >c99 -Wc,LP64 -Wl,LP64 -o timepgm time.c
> IBMUSER:/u/arcis: >timepgm
> 
>   67174442      Killed  ./timepgm
> IBMUSER:/u/arcis: >
> 
> In summary:
> - in batch & AMODE 64, only time() fails;
> - in USS & AMODE 64, the entire program fails.
> 
> TIA for additional comments/suggestions.
> 
> BTW, just to be sure: you made your test using IBM's z/OS XL C, or did you
> use SAS/C?
> 
> Regards,
> 
> Michel Castelein
> --------------------------------------------------
> Michel Castelein - Arcis Services
> MVS-OS/390-z/OS system engineer & instructor
> arcis[at]advalvas[dot]be
> http://www.geocities.com/michelcastelein/


-- 
Don Poitras - zSeries R & D  -  SAS Institute Inc. -  SAS Campus Drive 
mailto:[EMAIL PROTECTED]   (919)531-5637  Fax:677-4444     Cary, NC 27513

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to