i have a scenario with i/p as ID,salary with values 1,1000
2,2000 and 3,4000 i need an extra column in the o/p named
amount with values 2000,4000 and NULL. how can i get it?

Answers were Sorted based on User's Feedback



i have a scenario with i/p as ID,salary with values 1,1000 2,2000 and 3,4000 i need an extra colum..

Answer / snr

Using TRS Satge with this logic

If ID=left(salary,1) then Salary*2 else 'Null'

Is This Answer Correct ?    12 Yes 1 No

i have a scenario with i/p as ID,salary with values 1,1000 2,2000 and 3,4000 i need an extra colum..

Answer / rahul baheti

Input - Transfer - Output
In Transfer, apply the order by desc on ID and define two stage variable (SVC1, SVC2) put the if condition in stage variable against SVC1 (If SVC1 = NULL then setnull() else SVC1 = SVC2) and in SVC2, assian the sal.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Data Stage Interview Questions

How and where you used hash file?

0 Answers  


I have oracle enterpaise stage, oracle bulkloader stage, ODBC stage and I want to load data in to target, which of the above stages do I need to use and why?

3 Answers   Virtusa,


what is snow flack schema?

2 Answers  


cust id,cust quty like 1,101;1,102;1,103 i want output like cust id,cust quty 1 101,102,103 in oracle please write a query in oracle

3 Answers   TCS,


State the difference between an operational datastage and a data warehouse?

0 Answers  






what are fact tables and dimension tables? give example assuming one table.

3 Answers   IBM,


can a fact table contains textual information

6 Answers   HCL, HCL BSERV, IBM,


What are iconv and oconv?

0 Answers  


hi my source is:: empno,deptno,salary 1, 10, 3.5 2, 20, 8 2, 10, 4.5 1, 30, 5 3, 10, 6 3, 20, 4 1, 20, 9 then target should be in below form... empno,max(salary),min(salary),deptno 1, 9, 3.5, 20 2, 8, 4.5, 20 3, 6, 4, 10 can anyone give data flow in data stage for the above scenario.... thanks in advance...

5 Answers  


create a job that splits the data in the Jobs.txt file into four output files. You will direct the data to the different output files using constraints. • Job name: JobLevels • Source file: Jobs.txt • Target file 1: LowLevelJobs.txt &#8722; min_lvl between 0 and 25 inclusive. &#8722; Same column types and headings as Jobs.txt. &#8722; Include column names in the first line of the output file. &#8722; Job description column should be preceded by the string “Job Title:” and embedded within square brackets. For example, if the job description is “Designer”, the derived value is: “Job Title: [Designer]”. • Target file 2: MidLevelJobs.txt &#8722; min_lvl between 26 and 100 inclusive. &#8722; Same format and derivations as Target file 1. • Target file 3: HighLevelJobs.txt &#8722; min_lvl between 101 and 500 inclusive. &#8722; Same format and derivations as Target file 1. • Rejects file: JobRejects.txt &#8722; min_lvl is out of range, i.e., below 0 or above 500. &#8722; This file has only two columns: job_id and reject_desc. &#8722; reject_desc is a variable-length text field, maximum length 100. It should contain a string of the form: “Level out of range: <min_lvl>”, where <min_lvl> is the value in the min_lvl field. My Question is how do you write the stage variable for reject rows.

0 Answers   HCL,


How to display errors in datastage?

1 Answers   TCS,


What is the importance of the exception activity in datastage?

0 Answers  


Categories