Pages

Monday, September 8, 2014

Peek Stage


The Peek stage is a Development/Debug stage. It can have a single input link and any number of output links.
The Peek stage lets you print record column values either to the job log or to a separate output link as the stage copies records from its input data set to one or more output data sets.

1. Design :

We are using below design to demonstrate the functionality of PEEK stage in datastage. Job design is having 3 stages, Row Generator , data source, for generating the dummy data for the job. Here, we can use any data source whether it is DB, dataset or flat files. Transformer, just as a stage, creating negative values of source data. Peek for Peeking :-) 


2. Row Generator Stage Properties :-

We are generating 100 records via Row Generator stage. Just set the Number of Records to 100 as shown below ...
and define the metadata......

3. Transformer Stage Properties :-

Whatever the data has been generated by source, we are simply negating by multiplication of -1. Here, we dont need this stage but for shake of doing something I have used here. :-) 

4. PEEK Stage Properties :-

In English language the meaning of PEEK word is "To glance quickly". Peek stage is doing same in datastage, we are using this stage for debugging and looking the intermediate data if needed.
In our scenario, we have used below setting for our Peek Stage.


- ROWS  -- In this we can define, whether we needed ALL ROWS or some rows. Both properties are mutually exclusive. If we need ALL ( ALL Records = TRUE ), Number of Records property will not be available for vice versa.

- COLUMNS - Same for COLUMN properties, need to define whether you need all or some column. In case of "PEEK All Input Column = FALSE" , need to defined which column you needed in output.

- PARTITION  - Same as above

- OPTION - Here, you can select where you want the output , In a file or DS job log and You needed the column names along with data or not.


5. PEEK Stage Output

Below I have attached a screen shot from DS job log where 

Double click any entry and vola :) , You can see the data in job log. For our design, we are generating negative integer values which we can see in output.

 There are lot more in PEEK stage, we will cover in next posts :-). Till then, Keep Learning n Sharing.

No comments:

Post a Comment