MV GETDATA
This command returns some or all of the collected view data.
In addition, BMC Software recommends 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 |
---|---|
MainView | 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 numericThe 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-99999 numericThe default is all rows. To request a subset of the data, specify a START value and a COUNT value. |
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: MSG: Exception messages are written to the journal. NOMSG: No exception messages are written to the journal (default). |
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 | optional keyword If not specified, the default is NO. Valid values are as follows: NO: Column names are not generated. The value found in the HDR1 information for a column is used. You will likely have to customize the view when you use this option because blanks and special characters in the HDR1 information will cause a column to be unavailable in the EXEC. Prior to MainView AutoOPERATOR version 6.4, this process is how column names were created. YES:Column names will be generated. Names are generated by concatenating the HDR1 and HDR2 values for a column, stripping invalid leading characters, and replacing all other invalid characters and blanks with an underscore (_) character. This generated name is used as the variable name to reference the column of data. If a column has no heading information, a name will be generated in the form of @NOLABELnnnn where nnnn is the column number. For example, @NOLABEL6 is generated for column 6 of a view (if that column has no heading information). DATAN:Column names are generated using the internal DATANAME (element name) for the column of data. If a column has no internal DATANAME, a name will be generated in the form of @NODATANnnnn where nnnn is the column number. For example, @NODATAN6 is generated for column 6 of a view (if that column has no internal DATANAME). |
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 MainView AutoOPERATOR 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