In order to convert flat files into VSAM, follow the steps below:
Step1: Decide what is going to be your primary key. Alternatively, you can use the entire record as your primary key.
Step2: Sort the file by the primary key, or the entire record if no primary key is specified. Drop duplicates using a SORT statement.
Step3: Next, you must run a JCL command (IDCAMS - Define Cluster) with step-2 results/output (sorting mechanisms) as input.
Step4: Finally, to load the flat file into VSAM, use the IDCAMS REPRO command.