CSV2 first column

<< Click to Display Table of Contents >>

Navigation:  Reference > RCPs >

CSV2 first column

This RCP is needed if the data files being processed are CSV data files.

IMPORTANT: It should appear before the data files are defined with the C (cards) RCP.

When this RCP is present the data files should be of type CSV (Comma Separated Value).

The CSV files must have a header row which identifies the variables to be created. The values in mvar (multi-coded) columns must be separated by spaces as found in portable CSV files created by Companion programs.

If a column headed SERIAL or IOBS contains the serial numbers, you should include the SERIAL command at the top of the data stage:

serial number,

Access to the data from each record is done using $* as the location

Here are some simple example definitions of data from a CSV file:

ds $Q1=$*/1-4,

dm $Q2=$*/1,5,7,e,

di $Q3=$*,

dw $Q4=$*,

dc $Q5(20), dc $Q5=$*,

IMPORTANT: Note that cvars must have their size defined before the text is put into the variable from the CSV file.

Remember that the header row in the CSV must contain the variable names used, in this example Q1, Q2, and so on.

Example:

csvdata,