$DsnNum: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
 
No edit summary
Line 1: Line 1:
<p>$DSNNUM is useful with <var class="product">Model&nbsp;204</var> files that are comprised of multiple data sets. You specify the <var class="product">Model&nbsp;204</var> file's DD name or file name and $DSNNUM returns the total number of data sets defined for the file. </p>
<p>$DSNNUM is useful with <var class="product">Model&nbsp;204</var> files that are comprised of multiple data sets. You specify the <var class="product">Model&nbsp;204</var> file's DD name or file name and $DSNNUM returns the total number of data sets defined for the file. </p>
<p>The $DSNNUM syntax is:</p>
<p>The $DSNNUM syntax is:</p>
<p class="code">$DSNNUM('ddname')
<p class="syntax">$DSNNUM('<span class="term">ddname</span>')
</p>
</p>
<p>where:</p>
<p>where:</p>
<p>ddname is a file or data set's DD name. The file that you specify must be OPEN by you while you are using $DSNNUM. This ensures reliable output.</p>
<p><var class="term">ddname</var> is a file or data set's DD name. The file that you specify must be OPEN by you while you are using $DSNNUM. This ensures reliable output.</p>
<p>$DSNNUM returns a zero if the file or data set is not found. It returns a -1 for an argument syntax error.</p>
<p>$DSNNUM returns a zero if the file or data set is not found. It returns a -1 for an argument syntax error.</p>
<p>For a sequential file, the number of data set names is always one.</p>
<p>For a sequential file, the number of data set names is always one.</p>

Revision as of 19:15, 13 August 2013

$DSNNUM is useful with Model 204 files that are comprised of multiple data sets. You specify the Model 204 file's DD name or file name and $DSNNUM returns the total number of data sets defined for the file.

The $DSNNUM syntax is:

$DSNNUM('ddname')

where:

ddname is a file or data set's DD name. The file that you specify must be OPEN by you while you are using $DSNNUM. This ensures reliable output.

$DSNNUM returns a zero if the file or data set is not found. It returns a -1 for an argument syntax error.

For a sequential file, the number of data set names is always one.

The following example combines the use of $DSNNUM to identify the number of data sets that a file maps to, and then uses $DSN to print out the data set name.

%FILENAME IS STRING LEN 8 %FILENAME = 'MYFILE' PRINT 'FILE ' WITH %FILENAME WITH - 'IS CONTAINED IN THE FOLLOWING DSNS ' - PRINT FOR %I FROM 1 TO $DSNNUM(%FILENAME) PRINT $DSN(%FILENAME,%1) END