PowerExchange can automatically create empty sequential files or new generations of a Generation Data Group (GDG).
To create an empty sequential file or generation of a GDG, code a CREATEFILE command in the
Pre SQL
or the
Post SQL
session property for any PowerExchange source or target. PowerCenter uses the connection information from the source or target on which you code the command and passes the CREATEFILE command to PowerExchange. PowerExchange processes the command and creates the file.
To create a file before the session runs, code the CREATEFILE command in the
Pre SQL
property. To create a file after the session runs, code the CREATEFILE command in the
Post SQL
property.
A PowerCenter session with a PowerExchange target can create a new flat file or sequential data set even if you do not code the CREATEFILE command. When the session writes the first record to a file that does not exist, PowerExchange creates the file, using any data set allocation attributes that you specify in the session properties, if applicable. However, if the session does not write any records to the file, PowerExchange does not create it. In this case, if a task later in the workflow requires that the file exist, the task fails.
The following rules and guidelines apply to the CREATEFILE command:
You can code CREATEFILE commands for any source or target that uses a PowerExchange connection for which the
Pre SQL
or
Post SQL
property is available.
You do not need to create a PowerExchange data map or PowerCenter source or target definition for the file name that you code in the command.
When creating a file on i5/OS or z/OS, you can specify allocation information for the file by coding allocation parameters on the CREATEFILE command. Otherwise, the PowerExchange Listener that allocates the file uses allocation values from the DBMOVER configuration file or default values.
Because PowerExchange creates files either before or after a session runs, it does not use any allocation information specified in session properties for nonrelational sources or targets.
On i5/OS, Linux, UNIX, and Windows systems, the CREATEFILE command creates files that will open in append mode so that the file contents are not cleared.
On z/OS systems, the CREATEFILE command fails if the file already exists.
In certain cases, you must specify the
Pre SQL run once per Connection
attribute along with the
Pre SQL
attribute. Select the
Pre SQL run once per Connection
attribute in either one of the following cases:
You specify a CREATEFILE statement in the
Pre SQL
attribute for a session that uses writer partitioning. If you do not select
Pre SQL run once per Connection
, the session tries to run the statement once for each partition.
You specify a CREATEFILE statement that creates a new generation of a GDG or creates an empty file in the
Pre SQL
attribute for a session that performs a multiple-record write. If you do not select
Pre SQL run once per Connection
, the session creates a generation or tries to create a new empty file for each record that the session writes.
Select the
Retrieve PWX Log Entries
connection attribute to write all message output from the CREATEFILE command, including informational messages, to the PowerCenter session log. By default, this attribute is not selected, which causes only error and warning messages to be written to the session log.