subhash


{ City } hyderabad
< Country > india
* Profession * datastage developer
User No # 101246
Total Questions Posted # 15
Total Answers Posted # 100

Total Answers Posted for My Questions # 43
Total Views for My Questions # 145502

Users Marked my Answers as Correct # 554
Users Marked my Answers as Wrong # 33
Answers / { subhash }

Question { IBM, 14081 }

In which situations we can use normal and sparse lookup
stages


Answer

Normal lookup:-
If we have 90% data in primary like(source
table) and 10% data of Refference link(lookup table)in kind
of sutivation we can use normal lookup.and the normal
lookup data can stores in the temporary memory(RAM).

Sparse lookup:-
If we have 10% data in primary like(source
table) and 90% data of Refference link(lookup table)in kind
of sutivation we can use sparse lookup.and the sparse
lookup data can not stores in the temporary memory because
Refernce will have Huge data and for record(KEY Columns) from Source it will go to Reference Database and get the Output of it.

Is This Answer Correct ?    1 Yes 0 No

Question { IBM, 14081 }

In which situations we can use normal and sparse lookup
stages


Answer

Sparse LookUp:
for each source value, It will go refernce Database and get the Output.

Normal lookup:- 90% data in primary like(source
table) and 10% data of Refference link(lookup table)then we can use normal lookup.and the normal
lookup data uses in the temporary memory(RAM).

Sparse lookup:- 10% data in primary like(source
table) and 90% data of Refference link(lookup table)then we can use sparse lookup.

Is This Answer Correct ?    1 Yes 0 No


Question { IBM, 7715 }

i have data like
sam
ram
sam
raj
ram

I want two targets
trgt1
ram
sam

trgt2

raj
how can i do this in datastage?


Answer

1) If SRC is either Oracle or Seq File

SRC--->AGG---->fILTER---->TGT1
...................|
...................|
..................TGT2

the main data is:
sam
ram
sam
raj
ram
from aggregator stage, the output is:
sam,2
ram,2
raj,1

Then specify the count<>1 in the Filter for TGT1 then you get:
ram
sam

in another link for TGT2, give count=1. THEN YOU GET:
raj

2) If SRC is DataBase,

Orcl Conector----->Filter---->TGT1
.......................|
.......................|
......................TGT2

SELECT NAME, COUNT(NAME)
FROM EABLE_NAME
GROUP BY (NAME)
from the Above Query, the output is:
sam,2
ram,2
raj,1

Then specify the count<>1 in the Filter for TGT1 then you get:
ram
sam

in another link for TGT2, give count=1. THEN YOU GET:
raj

Is This Answer Correct ?    6 Yes 1 No

Question { Wipro, 7705 }

i want for the 3rd max sal using for the any stage but max
sal is based on the deptno ?
any body know this ans pls send this mail siva3me@gmail.com


Answer

Src ---> Tfm ---> Tgt
in the TRANSFORMER Stage.

Do the HASH partitioning the incoming data and 'Perform
Sort' on DEPTNO ASC order and SAL DESC order.

and use 2 STAGE VARIABLES sv1=0 & sv2=0.

sv2 ===> If sv1=DEPTNO Then sv2+1 Else 1
sv1 = DEPTNO

And Put the below Link contraint:
sv2=3


Then u will get 3rd highest SAL from each DEPT.

Is This Answer Correct ?    5 Yes 0 No

Question { Wipro, 5420 }

I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4
ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000
DATE-- COLUMN. I WANT TO DISPLAY THE DATA PREVIOUS MONTH
HIGEST SAL ?


Answer

Select MAX(SAL) FROM EMP
where to_char(Date,'MM-YYYY')=to_char(sysdate-1,'MM-YYYY')

Is This Answer Correct ?    1 Yes 1 No

Question { IBM, 20288 }

how can u find out the datastage job is running on how many
nodes


Answer

We can check in DataSatge Log as well.
Configuration file name is assigned in run time for the environment variable: $APT_CONFIG_FILE

Log:
"Environment variable settings:
_=/usr/bin/nohup
ADMIN_TEMPLATE_VERSION=Version: 1.0; Version Date: 09/01/2014
APT_COMPILEOPT=-c -O -fPIC -Wno-deprecated -m64 -mtune=generic -mcmodel=small
APT_COMPILER=g++
APT_CONFIG_FILE=/iis/ut02/InformationServer/Server/Configurations/ut02cmb-1Node.apt
"

We can the mentioned file for the Node configuration.

Is This Answer Correct ?    1 Yes 0 No

Question { 6569 }

In the source seq file have 2 columns, i.e
input:
col1,col2
1,1
2,rajesh
3,15000
4,2
5,suresh
6,16000
7,3
8,veeru
9,17000

I want in the output like:
eno,ename,sal
1,rajesh,15000
2,suresh,16000
3,veeru,17000

any one answer this scenario


Answer

SRC--->TFM--->PIVOT----> TGT

In TFM, use below logic
col1 MOD 3----->col1
then out from TFM is:
col1,col2
1,1
2,rajesh
0,15000
1,2
2,suresh
0,16000
1,3
2,veeru
0,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and pivot column is 'col2' then we will get desired output.

Is This Answer Correct ?    5 Yes 1 No

Question { 6569 }

In the source seq file have 2 columns, i.e
input:
col1,col2
1,1
2,rajesh
3,15000
4,2
5,suresh
6,16000
7,3
8,veeru
9,17000

I want in the output like:
eno,ename,sal
1,rajesh,15000
2,suresh,16000
3,veeru,17000

any one answer this scenario


Answer

SRC--->TFM--->PIVOT----> TGT

In TFM, use below logic
if col1<4 then 1 elseIf col1>3 AND col1<7 then 2 else 3-----
>col1
then out from TFM is:
col1,col2
1,1
1,rajesh
1,15000
2,2
2,suresh
2,16000
3,3
3,veeru
3,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and
pivot column is 'col2' then we will get desired output.

Is This Answer Correct ?    3 Yes 0 No

Question { IBM, 6234 }

I/P

---



ID Value

1 AB
2 ABC
3 ADE
4 A

O/p
---
ID Value
1 A
1 B
2 A
2 B
2 C
3 A
3 D
3 E
4 A


Answer

SRC-->TFM--->TGT
in TFM, Use Stage variables and Loop variables as below:

StageVar-->Len(Lnk.Value)===>this will give length of string of "Value" column. i.e.,
ID Value StageVar

1 AB 2
2 ABC 3
3 ADE 3
4 A 1

Next, in the Loop variable part:
Loop While==> @ITERATION<= StageVar
For each input row, Loop will repeat until "Value" length finishes.

Add new Loop variable-->LoopVar and put below derivation:
Left(lnkCstIPSGMSPread.IJABL, @ITERATION)-->LoopVar

Next, in the Output Col Derivation:
Lnk.ID-->ID
LoopVar-->Value

Finally, you will required Output.

Is This Answer Correct ?    4 Yes 0 No

Question { 19822 }

I have a scenario like
Deptno=10---->First record and last record
Deptno=20---->First record and last record
Deptno=30---->First record and last record
I want those first and last records from each department in
a single target. How to do this in DataStage, any one can
assist me.
Thanks in advance.


Answer

1.
Source--->Sort stage--->copy stage======>(SRC1,SRC2)
From copy stage we have to take two source stages
(SRC1,SRC2)
SRC-->Removeduplicate stage(in this we can get first
record from each dept--> Duplicates To Retain=First)
SRC2--->Remove duplicate stage(in this we can get last
record from each dept--> Duplicates To Retain=Last)
using funnel we can add these results.

2.
source->sortstage->removeduplications->dataset

in sortstage->create key changecolumn=true
this will set '1' for 1st records and '0' next duplicate
records.
after
removeduplicates stage(key columns=Deptno, CreateKeyChange
Columns)->duplicates retain:-last

we can get last(CreateKeyChange is zero and from all the
duplicates in that group, we are retaing last record) and
first(CreateKeyChange is 1) record group(Dept) wise.

Is This Answer Correct ?    2 Yes 0 No

Question { IBM, 9938 }

There are two file are there .1st file contains 5 records and
2nd file contain 10 records in target they want 50 records.how
can achieve this


Answer

to the both file we need to add one DUMMY column(value is
like '1', we can use Column generator for this DUMMy column
generation)
then we can JOIN these 2 files based on this DUMMY column.
so, each column of File1 will join with each column of File2
i.e. 5*10= 50 records will come into output.

Is This Answer Correct ?    6 Yes 0 No

Question { US Technology, 7898 }

source
1123445
I WANT OUTPUT AS
DUPLICATES TO TARGET1 LIKE
TARGET1
1144
NON-DUPLICATES TO TARGET2
TARGET2
235


Answer

Source
..|
..|
copy--->agg
..|.....|
..|.....|
join stage
....|
....|
Filter stage -----> target1
..|
..|
target2

the main data is:
1
1
2
3
4
4
5
from aggregator stage, the output is:
1,2
2,1
3,1
4,2
5,1

If you join these two links then the output will be:
1,2
1,2
2,1
3,1
4,2
4,2
5,1

Then specify the count<>1 in the Filter for target1 then you get the duplicate records. means YOU get:
1
1
4
4

in another link for target2, give count=1. means YOU get:
2
3
5

Is This Answer Correct ?    8 Yes 0 No

Question { Cap Gemini, 12261 }

I have a file it contain 2 records like empname,company as
Ram, Tcs and Ram, IBM. But i want empname,
company1,company2 as Ram, TCS,IBM in the target. How?


Answer

The Simple way is:
SRCFile---->PIVOT Stage---->TGT
1. in PIVOT stage, select vertical PIVOT option.
2. specify the 'Array Size' as 2
3. select the 'Group by' check box for 'empname'
4. select the 'Pivot' check box for 'company'
then u will get the desired output.

Is This Answer Correct ?    11 Yes 1 No

Question { TCS, 13257 }

1)How to Duplicate Records Delete in Sequential file?


Answer

small correction to Vinod answer,
If we use UNIQ, it will remove duplicate if they are
consecutive only..
so, better to use
sort -u
or
sort file_name | uniq

Is This Answer Correct ?    9 Yes 0 No

Question { 8598 }

Source flat file contains
src
---
1
2
'
'
'
18
we had 3 targets
T1 T2 T3
-- -- --
1 4 7
2 5 8
3 6 9
10 13 16
11 14 17
12 15 18

How can i get?
**Using only datastage, but not unix or any other.
I am expecting the answer soon..
Thanks in advance.


Answer

I hope this will help you:

--------->T1
|
|
source---->transformer---------- -------->T2
|
|
--------->T3
Transformer:
1.drag source column to all the targets.
2.TARGET T1 constraint in Transformer:
Mod(input column, 9)=1 or Mod(input column, 9)=2 or Mod
(input column, 9)=3.
3.TARGET T2 constraint in Transformer:
Mod(input column, 9)=4 or Mod(input column, 9)=5 or Mod
(input column, 9)=6.
4.TARGET T3 constraint in Transformer:
Mod(input column, 9)=7 or Mod(input column, 9)=8 or Mod
(input column, 9)=0.

Is This Answer Correct ?    7 Yes 1 No

Prev    1   2   3    [4]   5   6   7    Next