z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


PULL

z/OS TSO/E REXX Reference
SA32-0972-00

Read syntax diagramSkip visual syntax diagram
>>-PULL-+---------------+-;------------------------------------><
        '-template_list-'     

PULL reads a string from the head of the external data queue. It is just a short form of the instruction:
Read syntax diagramSkip visual syntax diagram
>>-PARSE UPPER PULL--+---------------+--;----------------------><
                     '-template_list-'      

The current head-of-queue is read as one string. Without a template_list specified, no further action is taken (and the string is thus effectively discarded). If specified, a template_list is usually a single template, which is a list of symbols separated by blanks or patterns or both. (The template_list can be several templates separated by commas, but PULL parses only one source string; if you specify several comma-separated templates, variables in templates other than the first one are assigned the null string.) The string is translated to uppercase (that is, lowercase az to uppercase AZ) and then parsed into variables according to the rules described in the section on parsing (see Parsing). Use the PARSE PULL instruction if you do not desire uppercase translation.

The TSO/E implementation of the external data queue is the data stack. REXX execs that run in TSO/E and non-TSO/E address spaces can use the data stack. In TSO/E, if the data stack is empty, PULL reads from the:
  • Terminal (TSO/E foreground)
  • Input stream, which is SYSTSIN (TSO/E background).

In non-TSO/E address spaces, if the data stack is empty, PULL reads from the input stream as defined by the file name in the INDD field in the module name table (see Module name table). The system default is SYSTSIN. If SYSTSIN has no data, the PULL instruction returns a null string.

The length of each element you can place onto the data stack can be up to one byte less than 16 megabytes.

Example:
Say 'Do you want to erase the file?  Answer Yes or No:'
Pull answer .
if answer='NO' then say 'The file will not be erased.'

Here the dummy placeholder, a period (.), is used on the template to isolate the first word the user enters.

The QUEUED built-in function (see QUEUED) returns the number of lines currently in the external data queue.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014