top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Informatica Source, Target Command Makes File Processing Easier than Before

+4 votes
983 views

Most of the time when we process flat files in Informatica PowerCenter, we do some kind of file pre or post processing, such as unzip the source file, create a custom header or footer for the target file etc. Such processing is normally done using UNIX or Windows scripts, which is called using pre or post session script. Now Informatica PowerCenter has provided Source, Target Commands to make such processing easy than before.

File Command Property
Using Source or Target Command property, either a UNIX or a Windows command can be used to generate flat file source data input rows or file list or a session. Command writes data into stdout and PowerCenter interprets this as a file list or source data. We can use service process variables like $PMSourceFileDir in the command.

Use Cases for File Command Property
In this article, let’s discuss couple of use cases, which can be handled easily using File Source, Target Commands. These properties can be further used as per different business needs, but let’s see couple of them here.

Use Case 1: Read a Compressed Source File.
Before the file is read, the file needs to be unzipped. We do not need any other pre- session script to achieve this. This can be done easy with the below session setting.
enter image description here
This command configuration generates rows to stdout and the Flat file reader reads directly from stdout, hence removes need for staging data.

Use Case 2: Generating a File List.
For reading multiple file sources with same structure, we use indirect file method. Indirect file reading is made easy using File Command Property in the session configuration as shown below.
enter image description here
Command writes list of file names to stdout and PowerCenter interprets this as a file list.

Use Case 3: Zip the Target File.
We can zip the target file using a post session script. but this can be done without a post session script as shown in below session configuration.
enter image description here

Use Case 4: Custom Flat File Column Headings.
You can get the column heading for a flat file using the session configuration as below. This session setting will give a file with header record 'Cust ID, Name, Street #, City, State, ZIP'
enter image description here

Use Case 5: Custom Flat File Footer.
You can get the footer for a flat file using the session configuration as given in below image. This configuration will give you a file with ****** End Of The Report ****** as the last row of the file.
enter image description here

These properties can be further used as per different business needs.

posted Apr 24, 2014 by Shatark Bajpai

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button


Related Articles

Informatica Power Exchange connection will not allocate empty data set file if no data loaded to target.

Create empty data set file using Informatica Pre SQL command when Power Exchange file used as Target file.

Solution:
Execute a CREATEFILE command to allocate the file in mainframe using "PreSQL" Command of Informatica.

Ensure to have following parameters to create an empty data set file in the mainframe.
* Data Set Name
* RECFM
* LRECL
* SPACE

Pre SQL Command Example:
CREATEFILE FN="HDDRK.ADFSAM.AWM3001.CI(+1)"
RECFM=FB
LRECL=356
SPACE= (TRK (10, 5))

Also ensure to have settings at the session level as shown below.
enter image description here

READ MORE
...