Folder stages are used to read or write data as files in a directory located on the DataStage server.

The folder stages can read multiple files from a single directory and can deliver the files to the job as rows on an output link. The folder stage can also write rows of data as files to a directory. The rows arrive at the stage on an input link.

Note: The behavior of the Folder stage when reading folders that contain other folders is undefined.

In an NLS environment, the user running the job must have write permission on the folder so that the NLS map information can be set up correctly.

Folder Stage Input Data

The properties are as follows:

Preserve CRLF. When Preserve CRLF is set to Yes field marks are not converted to newlines on write. It is set to Yes by default.

The Columns tab defines the data arriving on the link to be written in files to the directory. The first column on the Columns tab must be defined as a key, and gives the name of the file. The remaining columns are written to the named file, each column separated by a newline. Data to be written to a directory would normally be delivered in a single column.

Folder Stage Output Data

The properties are as follows:

Sort order. Choose from Ascending, Descending, or None. This specifies the order in which the files are read from the directory.

Wildcard. This allows for simple wildcarding of the names of the files found in the directory. Any occurrence of * (asterisk) or … (three periods) is treated as an instruction to match any or no characters.

Preserve CRLF. When Preserve CRLF is set to Yes newlines are not converted to field marks on read. It is set to Yes by default.

Fully qualified. Set this to yes to have the full path name of each file written in the key column instead of just the file name.

The Columns tab defines a maximum of two columns. The first column must be marked as the Key and receives the file name. The second column, if present, receives the contents of the file.

Leave a Reply