/*---------------------------------------------------------------------+
| Copyright (c) 1995, SAS Institute Inc. |
| Unpublished - All Rights Reserved |
| S A S / C S A M P L E |
| |
| NAME: ECBTASK |
| LANGUAGE: C |
| PURPOSE: ECBTASK, along with ECBMAIN show how to invoke an |
| existing C MAIN module, using SAS/C MVS multi-tasking |
| facilities. ECBTASK may be executed stand-alone, or |
| attached by ECBMAIN. The SAS/C ATTACH() function is |
| called from: prefix.SAMPLE(ECBMAIN), sub_attach(). |
| Additional details on multi-tasking may be found in the|
| SAS/C Library Reference, Third Edition, Release 6.00. |
| MVS - |
| COMPILE, LINK, EXECUTE: SUBMIT prefix.SAMPLE.AUX(ECBMAINJ) |
| where "prefix" is the installation defined high-level- |
| qualifier for the SAS/C product. |
| TSO - |
| COMPILE: LC370 CLIST |
| LINK: CLK370 CLIST |
| EXECUTE: CALL 'your.local.load(ECBTASK)' 'parms' |
| CMS - |
| COMPILE: LC370 EXEC |
| LINK: CLK370 EXEC |
| EXECUTE: ECBTASK |
| NOTES: Multi-tasking is not supported in CMS, however ECBTASK |
| may be executed as a stand-alone C MAIN program. |
| |
+---------------------------------------------------------------------*/
#include <lclib.h>
#include <stdio.h>
#include <time.h>
main(int argc, char *argv[])
{
int count, len;
char buffer[100];
time_t cur_time;
len = 0;
memset(buffer,'\0', 100*sizeof(char));
time(&cur_time);
printf("Entered ECBTASK: %s", ctime(&cur_time));
/*-------------------------------------------------------------------+
| ecbtask will receive a normal C Main argc, argv[] parameters list. |
| parse the parameter list and print out the the values. |
+-------------------------------------------------------------------*/
for (count=1; count < argc; count++ )
{
sprintf(&buffer[len],"%s ",argv[count]);
len = strlen(buffer);
}
printf("Input parameters ==> %s\n",buffer);
sleep(5);
time(&cur_time);
printf("Exiting ECBTASK: %s", ctime(&cur_time));
exit(0);
}
|