Chapter Contents

Previous

Next
waitrd

waitrd



Invoke the CMS WAITRD Function

Portability: SAS/C extension


SYNOPSIS
DESCRIPTION
RETURN VALUE
CAUTION
ERRORS AND DIAGNOSTICS
PORTABILITY
IMPLEMENTATION
EXAMPLE
SEE ALSO


SYNOPSIS

#include <wrterm.h>

int waitrd(char *inbuf, short inbufsz, char code1, char code2,
           char *pbuf, int pbufsz, int *inlen);


DESCRIPTION

waitrd invokes the CMS WAITRD function to read a line of input from the program stack or terminal input buffer. The waitrd macro creates a WAITRD parameter list and generates an inline SVC 202. A description of each of the arguments follows:

inbuf
is a pointer to a buffer into which the input line is read.

inbufsz
is the length of the input buffer.

code1
specifies the processing performed on lines read from the terminal input buffer. <wrterm.h> contains definitions for a number of macros, each of which corresponds to a WAITRD function code1 parameter. Macros Defined for the waitrd code 1 Argument lists the macro names and the associated code1 values.

code2
specifies additional processing codes. Again, <wrterm.h> contains definitions for a number of macros, each of which corresponds to a WAITRD function code2 parameter. Macros Defined for the waitrd code 2 Argument lists the macro names and the associated code2 values. For an explanation of each of the code1 and code2 values, refer to Chapter 1 in VM/SP Command and Macro Reference appropriate for your release.

pbuf
is a pointer to a prompt string. If code2 is PROMPT_NO, this argument is ignored.

pbufsz
is the length of the prompt string. If code2 is PROMPT_NO, this argument is ignored.

inlen
is a pointer to an int where the length of the input string is stored.


RETURN VALUE

waitrd returns the value in register 15 when the WAITRD function returns.


CAUTION

In XA CMS or ESA, waitrd can only be used in 24-bit addressing mode.


ERRORS AND DIAGNOSTICS

The possible errors are the same as when the WAITRD function is used in an assembler language program.


PORTABILITY

waitrd is not portable.


IMPLEMENTATION

The waitrd macro creates a WAITRD parameter list in the CRABTAUT work area. (See the SAS/C Compiler and Library User's Guide for more information about CRABTAUT.)


EXAMPLE

   /* Read an input line of at most 25 characters */
   /* from the terminal.                          */
char *name[25] ;
char *prompt = "Please enter your name."
int rc;
int inlen;

   /* Ask for the input to be  */
   /* translated to uppercase. */
rc = waitrd(name,sizeof(name),STACK_UPCASE,PROMPT_YES,
     prompt, strlen (prompt),&inlen);


SEE ALSO

See VM/SP CMS Command Reference.

Macros Defined for the waitrd code 1 Argument
Macro Name Corresponding Value
RD_EDIT_YES U
RD_EDIT_NO T
RD_EDIT_PHYS X
RD_EDIT_PAD S
RD_EDIT_UPCASE V
RD_EDIT_NOINPT Y
STACK_UPCASE Z
STACK_MIXED W
ATTREST_YES *
ATTREST_NO $

Macros Defined for the waitrd code 2 Argument
Macro Name Corresponding Value
PROMPT_DIRECT B
TYPE_DIRECT D
PROMPT_YES P
PROMPT_NO 0


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.