Chapter Contents |
Previous |
Next |
intractv |
Portability: | SAS/C extension |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
CAUTION | |
EXAMPLE |
SYNOPSIS |
#include <lclib.h> int intractv(void);
DESCRIPTION |
intractv
indicates whether a program is executing interactively. The
time-sharing flag is stored in byte 29 of the environment descriptor block.
RETURN VALUE |
Except for USS programs called with
exec
-linkage,
intractv
returns a nonzero integer if a program
is executing interactively; otherwise, it returns
0
.
For a program called with
exec
-linkage,
intractv
returns whether or not a TSO terminal is accessible. Therefore, in
most cases of
exec
-linkage,
intractv
returns
0
; however, for a program invoked via the
oeattach
or
oeattache
function under TSO, interactive returns
nonzero.
CAUTION |
See "Caution" under The L$UENVR Routine.
EXAMPLE |
#include <lclib.h> #include <stdio.h> #include <string.h> FILE *in_file; char *sys_file; /* Issue prompt only if running interactively. */ if (intractv()) { printf("Enter data:"); fflush(stdout); /* Perform other functions to read data in interactively.*/ . . . } /* Otherwise, obtain input from DATA file. */ else { if (memcmp(sysname(), "CMS", 3) == 0) sys_file = "DATA FILE A1"; else sys_file = "SYSIN"; in_file = fopen(sys_file, "r"); }
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.