VSAM File Creation (Loading)
The FILE statement and the PUT statement are used to create (load)
VSAM files. The PUT statement provides for sequential file output to VSAM
files.
FILE MASTER FB ( 150 1800 )
EMP# 9 5 N
NAME 17 16 A
GROSS 94 4 P 2
FILE OUTMAST VS ( CREATE RESET )
JOB INPUT MASTER NAME CREATE-VSAM
PUT OUTMAST FROM MASTER STATUS
IF OUTMAST: FILE-STATUS NOT ZERO
DISPLAY ‘LOAD ERROR STATAUS IS : ‘ +
OUTMAST : FILE-STATUS
STOP
END-IF
PRINT RPT1
REPORT RPT1
LINE 1 EMP# NAME GROSS
EMP# 9 5 N
NAME 17 16 A
GROSS 94 4 P 2
FILE OUTMAST VS ( CREATE RESET )
JOB INPUT MASTER NAME CREATE-VSAM
PUT OUTMAST FROM MASTER STATUS
IF OUTMAST: FILE-STATUS NOT ZERO
DISPLAY ‘LOAD ERROR STATAUS IS : ‘ +
OUTMAST : FILE-STATUS
STOP
END-IF
PRINT RPT1
REPORT RPT1
LINE 1 EMP# NAME GROSS
STATUS
When you specify STATUS, VSAM return codes are returned to the
system defined field FILE-STATUS.
FILE-STATUS
FILE-STATUS is a system defined field which you can test to
identify the result of a VSAM input / output operation.
No comments:
Post a Comment