$EdScan: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 7: Line 7:


The <var>$EdScan</var> function accepts four arguments and returns a number indicating the success of the function.
The <var>$EdScan</var> function accepts four arguments and returns a number indicating the success of the function.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%result = $EdScan(image_name, type, scope, name)
<p class="syntax"><section begin="syntax" />%result = $EdScan(image_name, type, scope, name)
Line 15: Line 16:


<ul>
<ul>
<li>The first argument is a string identifying an image to receive returned data. This image must have the following format :
<li>The first argument is a string identifying an image to receive returned data. This image must have the following format :
<p class="code"> IMAGE EB_IMAGE
<p class="code"> IMAGE EB_IMAGE
Line 47: Line 47:
</p>
</p>
ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.  
ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.  
<li>The second argument is a string indicating the type of entity for which information is to be returned. Valid types are
<li>The second argument is a string indicating the type of entity for which information is to be returned. Valid types are
<table class="syntaxTable">
<table class="syntaxTable">
Line 63: Line 64:
</td></tr></table>
</td></tr></table>
This is an optional argument.  
This is an optional argument.  
<li>The third argument is a string indicating the scope of the entities for which information is to be returned. Valid scopes are 'SYSTEM' and 'USER'. This is an optional argument. If not specified, all entities are returned.  
<li>The third argument is a string indicating the scope of the entities for which information is to be returned. Valid scopes are 'SYSTEM' and 'USER'. This is an optional argument. If not specified, all entities are returned.  
<li>The fourth argument is the name of the entity for which information is to be returned. This is an optional argument but if it is specified, arguments 2 and 3 are also required.
<li>The fourth argument is the name of the entity for which information is to be returned. This is an optional argument but if it is specified, arguments 2 and 3 are also required.
</ul>
</ul>


In the image indicated by argument 1, LOOP_VAR must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, <var>$EdScan</var> will set LOOP_VAR to the number of entries skipped plus one if an entity is returned and to the number of entries skipped if not. Thus, multiple invocations of <var>$EdScan</var> without setting LOOP_VAR will return information on all appropriate entities.<p>
In the image indicated by argument 1, LOOP_VAR must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, <var>$EdScan</var> will set LOOP_VAR to the number of entries skipped plus one if an entity is returned and to the number of entries skipped if not. Thus, multiple invocations of <var>$EdScan</var> without setting LOOP_VAR will return information on all appropriate entities.
 
===Status codes===
<p class="code">
   0 - Entity found, image set
   0 - Entity found, image set
   4 - Entity not found, or off end of chain
   4 - Entity not found, or off end of chain
Line 74: Line 80:
  16 - Image specified by argument 1 not found
  16 - Image specified by argument 1 not found
  20 - Image specified by argument 1 not active, or too short
  20 - Image specified by argument 1 not active, or too short
</p>
<p class="caption">$EdScan return codes
</p>
</p>


==Example==
The following program prints the DD and DSNAME of all ALLOCATE'd datasets.
The following program prints the DD and DSNAME of all ALLOCATE'd datasets.


<p class="code"> B
<p class="code">B
IMAGE JUNK
IMAGE JUNK
LOOP_VAR IS BINARY LEN 4
LOOP_VAR IS BINARY LEN 4
  ...
  ...
END IMAGE
END IMAGE
   
   
PREPARE IMAGE JUNK
PREPARE IMAGE JUNK
REPEAT FOREVER
REPEAT FOREVER
%RC = $EdScan('JUNK', 'ALLOCATE', 'SYSTEM')
%RC = $EdScan('JUNK', 'ALLOCATE', 'SYSTEM')
IF %RC ^= 0 THEN
IF %RC ^= 0 THEN
STOP
STOP
END IF
END IF
PRINT %JUNK:NAME AND %JUNK:DSNAME
PRINT %JUNK:NAME AND %JUNK:DSNAME
END REPEAT
END REPEAT
END
END
</p>
</p>


Line 106: Line 111:
<li>[[Japanese functions]]</li>
<li>[[Japanese functions]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p>
<p>

Revision as of 01:03, 26 October 2012

Scan list of entities in online

Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no OO equivalent for the $EdScan function.

This function scans the list of defined entities in the online region. Entities can be 204 datasets, sequential files or streams, printers, punches or processes.

The $EdScan function accepts four arguments and returns a number indicating the success of the function.

Syntax

<section begin="syntax" />%result = $EdScan(image_name, type, scope, name) <section end="syntax" />

%result is a 0 or to an error code.

  • The first argument is a string identifying an image to receive returned data. This image must have the following format :

    IMAGE EB_IMAGE LOOP_VAR IS BINARY LEN 4 NAME IS STRING LEN 8 SCOPE IS STRING LEN 6 TYPE IS STRING LEN 8 * THIS SECTION USED JUST FOR DATASETS + ALLOCATES DSNAME IS STRING LEN 44 DSORG IS STRING LEN 10 ALLOC IS STRING LEN 4 DISP IS STRING LEN 5 * THIS SECTION JUST USED FOR PRINTERS + PUNCHES CLASS IS STRING LEN 1 ROUTE IS STRING LEN 8 ID IS STRING LEN 8 DIST IS STRING LEN 8 FORMS IS STRING LEN 8 * THIS SECTION JUST USED FOR LINKS TRANSPORT IS STRING LEN 8 AT DSNAME PROTOCOL IS STRING LEN 8 * THIS SECTION JUST USED FOR PROCESSES DESTINATION IS STRING LEN 8 AT DSNAME PARTNER IS STRING LEN 10 MODE IS STRING LEN 4 * THIS SECTION JUST USED FOR PROCESSGROUPS LINK IS STRING LEN 8 AT DSNAME REMOTEID IS STRING LEN 8 TERMINAL IS STRING LEN 8 END IMAGE

    ALLOC will return either NEW, OLD or COND and DISP returns either SHARE or EXCL. This is a required argument.

  • The second argument is a string indicating the type of entity for which information is to be returned. Valid types are
    ALLOCATE Files allocated by the ALLOCATE command.
    DATASET Files defined by the DEFINE DATASET command.
    PRINTER Printers defined by the DEFINE PRINTER command.
    PUNCH Punches defined by the DEFINE PUNCH command.
    STREAM Files defined by the DEFINE STREAM command.
    PROCESS Processes defined by the DEFINE PROCESS command.

    This is an optional argument.

  • The third argument is a string indicating the scope of the entities for which information is to be returned. Valid scopes are 'SYSTEM' and 'USER'. This is an optional argument. If not specified, all entities are returned.
  • The fourth argument is the name of the entity for which information is to be returned. This is an optional argument but if it is specified, arguments 2 and 3 are also required.

In the image indicated by argument 1, LOOP_VAR must be set to the number of entries matching the selection criterion that are to be skipped. Upon return, $EdScan will set LOOP_VAR to the number of entries skipped plus one if an entity is returned and to the number of entries skipped if not. Thus, multiple invocations of $EdScan without setting LOOP_VAR will return information on all appropriate entities.

Status codes

0 - Entity found, image set 4 - Entity not found, or off end of chain 8 - Invalid argument 1 or argument 2 12 - Argument 4 specified without argument 2 or 3 16 - Image specified by argument 1 not found 20 - Image specified by argument 1 not active, or too short

Example

The following program prints the DD and DSNAME of all ALLOCATE'd datasets.

B IMAGE JUNK LOOP_VAR IS BINARY LEN 4 ... END IMAGE PREPARE IMAGE JUNK REPEAT FOREVER %RC = $EdScan('JUNK', 'ALLOCATE', 'SYSTEM') IF %RC ^= 0 THEN STOP END IF PRINT %JUNK:NAME AND %JUNK:DSNAME END REPEAT END

Products authorizing $EdScan