$DSCALL OPT=READ

Reads one or more records from a data set.

&CONTROL SHRVARS=($DS)
EXEC $DSCALL OPT=READ 
             DATA= { * | variable_name [ , variable_name,... ] | prefix*} 
           { DD=DD_name | ID=path_name } 
           [ LIMIT= number ] 
           [ TRUNCATE= number ]

This option is used to read records from a data set or a member of a PDS into variables. The procedure must have an open path to the data set or PDS member to be read (use $DSCALL OPT=OPEN to open a path).

Operands:

Return Codes:

Note: For more information about &SYSMSG, &$DSRC, and &$DSFDBK, see Return Codes and Feedback Codes.

$DSFDBK is set to 9 and $DSRC set to 4 if the number of records specified by the LIMIT operand is not satisfied.

Return Variables:

Examples: OPT=READ

&CONTROL SHRVARS=($DS)
EXEC $DSCALL OPT=READ ID=SYSPATH DATA=* +
   LIMIT=9999
&CONTROL SHRVARS=($DS, ABC)
EXEC $DSCALL OPT=READ ID=SYSPATH DATA=ABC
&CONTROL SHRVARS=($DS, ABC)
EXEC $DSCALL OPT=READ ID=SYSPATH +
   DATA=ABC* LIMIT=9999


Copyright © 2009 CA. All rights reserved.