We have moved to www.dataGenX.net, Keep Learning with us.

Thursday, January 30, 2014

DataStage Scenario - Problem15


Goal : Get the Previous column value in current value 

Input file : 

Sq, No 
1,1000
2,2200
3,3030
4,5600

DataStage Scenario - Problem14


Goal : get below outputs


Input : 
dept, emp
----------------------------
20,            R
10,            A
10,            D
20,            P
10,            B
10,            C
20,            Q
20,            S 

Wednesday, January 29, 2014

DataStage Scenario - Problem13


Goal : Repeat the input as it is in input

Repeat the input in output, Here what we have to do is repeat the same row no of times in output file. Suppose if 2 is there then repeat 2 two times, 4 four times in output files.


Input :
2
3
4
1

Monday, January 27, 2014

DataStage Scenario - Problem12



Goal : Add a comment line with each row of input file


Input1 :

Name, Dept, Salary
CHRISTINE,A00,152750.00
MICHAEL,B01,94250.00
SALLY,C01,98250.00
JOHN,E01,80175.00
IRVING,D11,72250.00
EVA,D21,96170.00
EILEEN,E11,89750.00
THEODORE,E21,86150.00


Sunday, January 26, 2014

DataStage Scenario - Problem11


Which stages are needed to achieve below output ??

Input :

col1,col2
1,1
2,rajesh
3,15000
4,2
5,suresh
6,16000
7,3
8,veeru
9,17000 

Thursday, January 23, 2014

DataStage Scenario - Problem10


Goal :  Get the max salary from data file ( Seq file )

We know that max function is use to get the max value in a column of a table, but here you have to design a datastage job which get the max value from seq file.



Input Seq File :

Wednesday, January 22, 2014

DataStage Scenario - Problem9


Goal : Distribute the data is below requirement

Input file's data is distributed like 1st 3 row in file1, next 3 row in file2, next 3 rows in file3 again next 3 rows in file1 and continues.


Tuesday, January 21, 2014

DataStage Scenario - Problem8


Goal : Distribute the data as below condition -

Given : FileA and FileB contains some data in single column.
Target : File_A : Which contains the data which is available in A but not in B
Target : File_B : Which contains the data which is available in B but not in A
Target : File_AB : Which contains the data which is available in A and B Both

Monday, January 20, 2014

Tuesday, January 14, 2014

Removing last or more character of string


Want to remove last character from a string in Linux, We can do this with help of SED commands.

Use this

a) Remove last char
sed 's/.$//' input
or
sed 's/.\{1\}$//' input

i.e. -
echo 123456 | sed 's/.$//'
12345

echo 123456 | sed  's/.\{1\}$//'
12345

Friday, January 10, 2014

Datastage Common Errors and Solutions


1.
    
While running ./NodeAgents.sh start command... getting the following error: “LoggingAgent.sh process stopped unexpectedly”

SOL:   needs to kill LoggingAgentSocketImpl
              Ps –ef |  grep  LoggingAgentSocketImpl   (OR)
              PS –ef |               grep Agent  (to check the process id of the above)

2.     Warning: A sequential operator cannot preserve the partitioning of input data set on input port 0
SOL:    Clear the preserve partition flag before Sequential file stages.

Thursday, January 02, 2014

Sample Stage in DataStage


Sample stage is yet another development stage. It can have a single input link and any number of output links when operating in percent mode and have one o/p link when operating in period mode.

a) Job Design