PUNCH

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

PUNCH

The form of the PUNCH command is:

PUNCH [(stream)] x,

PUNCH [(stream)] ALL,

where x is a buffer or field, and stream should be one of the letters A through L.

The PUNCH command is used at the Data Stage to write the contents of x to an output data file.

If CARD NUMBERS are specified, then if x is specified, it must be within the range specified in the CARD NUMBERS command. If x is not specified, buffer 0 ($01-80) is written. If ALL is specified, buffers 1 through the maximum specified are assumed.

If CARD CHARACTERS are specified x must be a field. The output record will be the length specified on the CARD CHARACTERS command unless a field is used.

The PUNCH command can be used to create a new raw data file. This could be a subset of the original data, a summary file, a clean file or combinations thereof.

The names of the output data files are determined by use of the "P=" run control parameter, see the chapter on run control parameters.

If a designated buffer or field is empty, no output takes place, unless run control parameter BRP is set.

Punching to an ASCII (character) file converts the data to ASCII format. This may change data in the buffers where unrecognised multi-coding is found. Such data locations will be converted to the ASCII character '?' (codes /047/).

IMPORTANT: each PUNCH executed writes a new line to the output file. You cannot punch different parts of the same output record with different PUNCH commands.

You can punch a new data file with target or rim weights added by using run control parameter ITF to put the weighting tables back into a Data Stage.

Examples of PUNCH commands:

punch $201-256,

punch (b) all,

if $xierr/0, then,

punch (a) all,  

else,

punch (b) all,  

endif,