Sorry, I did not cut and paste the code correctly in my OP. Below is
what the code looks like

The coding look something like below:

char printThisBuf[110];

sprintf(printThisBuf, "argv[0]->%s\n", argv[0]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[1]->%s\n", argv[1]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[2]->%s\n", argv[2]);
printThis(printThisBuf);

sprintf(printThisBuf, "argv[3]->%s\n", argv[3]);
printThis(printThisBuf);


void
printThis(char *text)
{
char stime[20];

memset(stime, 0x0, sizeof(stime));
get_time_stamp(stime);
printf("%s %s\n", stime, text);
}

int get_time_stamp(char sString[])
{
time_t thetime;
struct tm *usetime;
char sTime[20];

time(&thetime);
usetime=localtime(&thetime);
sprintf(sTime,"%02d/",usetime->tm_mon+1);
sprintf(sTime+3,"%02d/",usetime->tm_mday);
sprintf(sTime+6,"%4u ", usetime->tm_year + 1900);
sprintf(sTime+11,"%02d:",usetime->tm_hour);
sprintf(sTime+14,"%02d:",usetime->tm_min );
sprintf(sTime+17,"%02d",usetime->tm_sec );
strcpy(sString,sTime);
return(1);
}


I call the program like this:
CALL PGM(*LIBL/RUN_ECDSTP) PARM('NOCC07QA' '5553' '*LIBL' UA_STP3)


This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].