C (cards)

<< Click to Display Table of Contents >>

Navigation:  Reference > RCPs >

C (cards)

This RCP specifies which input data file(s) to use in the Data Stage. Up to four data streams are allowed, known as A B C and D. If stream is not specified, stream A is assumed. READ commands may refer to any stream enabling you to process up to four files in parallel.

IMPORTANT: To read CSV files as data files you must include RCP CSVDATA.

There are three forms of the C (cards) RCP:

C[(stream)]=datafile[;datafile; ... datafile],

gives the data file(s) which are to be read.

For streams A and B up to 16 data files may be specified separated by semi-colons but the total number of characters in an RCP is restricted to 255 characters. This means that if long path names are used you may not get 16 filenames on one line.

Where more than one file is specified, the files are read consecutively (sequentially) in the order specified.

For streams C and D only one data file may be specified.

IMPORTANT: if the data file names contain spaces you must surround the whole names with quotes.

Data file names can be followed by (FIXEDLEN) and CL will assume that all records in this file are the maximum size so that any locked records can be skipped over.

C[(stream)]=<>,

asks you at the screen for the input data file name(s) at run time.

C[(stream)]=<listfile>,

For streams A and B only, gets the data file names from the listfile. If a list file is specified then any number of data files can be read sequentially; the names of the data files must be one per line in the list file with no additional characters (no comma at end).

Alternatively the list file can be a CSV (comma separated value) file. In this case the first row must be a header line and column A contains the list of data files which must be headed "DATAFILE". Other columns can be headed with the name of an ivar in the data stage and every time a line (card) is read from the data file this ivar will be set to the value alongside the data file. For example if the listfile contains:

datafile,year,wave

fred.asc,1,2

jen.asc,2,1

then every time a line is read from fred.asc $year is set to 1 and $wave is set to 2. Similarly every time a line is read from jen.asc $year is set to 2 and $wave is set to 1.

The ivars used should be named (but not set) at the beginning of the data stage, so for the above example:

di $year,

di $wave,

Any number of ivars can be set in this way to reflect the contents of data files.

Any relative path names in a listfile should be relative to the location of the listfile, not the CL script which refers to it.

At least one C (cards) RCP must be specified for an Execution Step unless the NOREAD parameter is set on the START DATA command.

Full path names and relative path names may be used in specifying data files.

Examples of C (cards) RCP:

c=input.cba,

c=data.csv,

c='project Sample.asc';'project Partial.asc(FIXEDLEN)',

c(a)=one.asc;two.asc;three.asc,

c(b)=c:\proj\data\job5.csi,

c(d)='My data file',

c=<>,

c(a)=<listd>,