MV GETDATA
In addition, we recommend accessing the array with the IMFEXEC MV GETDATAN command (see MV-GETDATAN) as a faster and easier alternative to the IMFEXEC MV GETDATA command.
Command | Parameters |
|---|---|
MV GETDATA | ARRAY(arrayName) [START(n)] [COUNT(n)] [REFRESH] CHANNEL(channelName) [NEWNAMES(YES | NO | DATAN)] |
The following table describes the parameters.
Parameter | Function | Notes |
|---|---|---|
ARRAY | Name of the array in which both the data and the data definition is returned | 1- to 31-characters alphanumeric The specified array must not exist. An existing array will not be overwritten. All information about the returned data is implicitly returned in the array. |
START | Starting row for the request | 1-99999 numeric The default is row 1. To request a subset of the data, specify a START value and a COUNT value. |
COUNT | Number of rows of data to retrieve | 1-32767 numeric The default is all rows. To request a subset of the data, specify a START value and a COUNT value. See the information for RC 4 in Stem-variables-returned-by-IMFEXEC-MV-GETDATAN for more information about retrieving more rows of data. |
REFRESH | Specifies that the selector for this data be restored | the first request for data from a view in a given channel requires REFRESH In addition:
|
Message option | Controls the writing of exception messages to the journal | One of the following values:
|
CHANNEL | Token that identifies a previously connected channel | 1- to 32-characters alphanumeric. |
NEWNAMES(YES | NO | DATAN) | Indicates how column names are to be created | If not specified, the default is NO. Valid values are as follows:
|
Condition codes are listed in the following table:
Value | Description |
|---|---|
0 | All of the requested data was successfully retrieved. |
4 | The specified array could not be built because it already exists. |
8 | The requested data could not be retrieved. Examine the accompanying error messages for details. If NOMSG was specified on CONNECT, display the contents of LINE.xxxx. This return code may also indicate that the START() keyword specified a value that was higher than the number of available records (in which case no records can be returned). |
12 | The specified channel could not be found. |
16 | A syntax error was detected or invalid parameters were supplied. |
20 | An internal error was received. |
24 | The number of rows returned exceeds the maximum allowed (or 32767). When this condition code is issued, 32767 rows of data is returned. After processing the returned data, the user can redrive the IMFEXEC MV GETDATA using ROW(32768) to obtain any additional rows. When redriving IMFEXEC MV GETDATA to obtain additional rows, do not use REFRESH. |
Example 1
This example shows an EXEC that retrieves data from a previously specified view in the channel called DATACHANNEL.
For all rows it prints the column with the element name VOL to the BMC AMI Ops Automation journal.
"IMFEXEC ARRAY INFO DASDSTAT"
"IMFEXEC MSG The following volumes are active:"
do i=1 to arylrows
"IMFEXEC ARRAY GET DASDSTAT SKIP"
"IMFEXEC MSG "vol
end
CLIST example:
ARRAY(DASDSTAT) START(1) COUNT(20) REFRESH
IMFEXEC ARRAY INFO DASDSTAT
IMFEXEC MSG The following volumes are active:
SET I=1
DO WHILE &I LE ARYLROWS
IMFEXEC ARRAY GET DASDSTAT SKIP
IMFEXEC MSG &VOL
SET I=&I+1
END
Example 2
This example shows a section of an EXEC that retrieves a new copy or version of the data within a DO loop structure, and ensures that the first time through the loop, a refresh occurs and that before any subsequent GETDATA commands are issued, the array is disconnected.
IF REFERSH_COUNT > 1 THEN
DO
"IMFEXEC ARRAY DISC RESULTS NOSAVE"
END
"IMFEXEC MV GETDATA CHANNEL("DASDCHANNEL") ARRAY(RESULTS) REFRESH"
IF IMFCC <> 0 THEN EXIT
"IMFEXEC ARRAY INFO RESULTS"
"IMFEXEC MSG 'The following volumes are active.'"
DO I = 1 TO ARYLROWS
"IMFEXEC ARRAY GET RESULTS SKIP"
"IMFEXEC MSG "vol
END
END