How to: Reference: |
The -READFILE command reads a file by first reading its Master File and creating Dialogue Manager amper variables based on the ACTUAL formats for each field in the Master File. It then reads the file and, if necessary, converts the fields from numeric values to alphanumeric strings before returning them to the created variables. Display options in the USAGE formats are not propagated to the variables. The names of the amper variables are the field names prefixed with an ampersand (&).
-READFILE mastername
where:
Is the name of the Master File to be read.
(FOC339) DIALOGUE MANAGER -READ FAILED: CHECK FILEDEF OR ALLOCATION FOR: -READFILE filename
(FOC702) THE OPTION SPECIFIED IS NOT AVAILABLE WITH TEXT FIELDS: fieldname
The following request creates a binary HOLD file, then uses -READFILE to read the first record from the HOLD file and type the values that were retrieved into Dialogue Manager variables. Note that the names of the variables are the field names prefixed with an ampersand.
TABLE FILE EMPLOYEE PRINT LAST_NAME FIRST_NAME DEPARTMENT CURR_SAL BY EMP_ID ON TABLE HOLD AS READF1 FORMAT BINARY END -RUN -READFILE READF1 -TYPE LAST_NAME IS &LAST_NAME -TYPE FIRST_NAME IS &FIRST_NAME -TYPE DEPARTMENT IS &DEPARTMENT -TYPE CURR_SAL IS &CURR_SAL -TYPE EMP_ID IS &EMP_ID
The output is:
> NUMBER OF RECORDS IN TABLE= 12 LINES= 12 HOLDING BINARY FILE... LAST_NAME IS STEVENS FIRST_NAME IS ALFRED DEPARTMENT IS PRODUCTION CURR_SAL IS 11000.00 EMP_ID IS 071382660
Information Builders |