DataStage Interview Questions

Showing Questions 1 - 20 of 736 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page:
  •  

    Having single input source want three different outputs.

    I have a source file having data like:
    10
    10
    10
    20
    20
    20
    30
    30
    40
    40
    50
    60
    70
    i want three output from the above input file, these output would be:
    1) having only unique records no duplicates should be there. Like:
    10
    20
    30
    40
    50
    60
    70
    2) having only duplicate records,...

    Ruchi Gautami

    • Dec 30th, 2019

    File -->> Sort -->> Transformer -->> O/P File
    Sort:
    Define the key field and in Property set Key Change column as TRUE.
    Transformer:
    In Constraints put the below condition:
    KeyChange=1 for Unique record O/P
    KeyChange=0 for Duplicate O/P.

    shaheed

    • Nov 20th, 2019

    Src->Sggr->Trans->Target(3)
    1) Unique- send as it is with link sort
    2) Duplicate only- Loop through Count of each row count (constraint Count . 1)
    3)Unique Only- Constraints Count = 1

  •  

    How to convert multiple rows into single row in datastage

    Hi,

    Can you please solve this in datastage..

    my input is
    name,city
    johnson,newyork
    johnson,mumbai
    johnson,delhi

    want output as
    name,city1,city2,city3
    johnson,newyork,mumbai,delhi

    pls explain with steps
    thanking in advance...

    Ruchi Gautami

    • Dec 30th, 2019

    File -->> Sort -->> Transformer -->> O/P File Sort: Enable key column change as true. Transformer: Define one stage variable SVar if key_change =1 then city else SVar:,:city Define 3 columns Cit...

    Alisha

    • Aug 8th, 2019

    Can you please elaborate the Staging variable condition? how we define staging variable and how we are putting in conditon

  •  

    Datastage Real time scenario

    source table
    name
    A
    A
    B
    B
    B
    C
    C
    D

    In source table data like this
    but I want traget table like this
    name count
    A 1
    A 2
    B 1
    B 2
    B 3
    C 1
    C 2
    D 1


    pls any one one solve this........

    Ruchi Gautami

    • Dec 30th, 2019

    Transformer:
    Take two stage variables Svar1 and Svar2.
    Condition for Svar1:
    if Svar2 =InputcolumnName Then Svar1+1 Else 1
    InputcolumnName=Svar2

    Lalit

    • Sep 12th, 2017

    Ans- First take one sequential file at input Now make a 4 node configuration file Take a transformer and set partitioning type = hash Now in transformer add extra column and...

  •  

    Single Column Source Data

    Source have single column data, How can I get Target like row 1 goes to target 1, row 2 goes to target 2.

    src :-
    column_id
    1
    2
    3
    4
    .
    .
    .
    1000 ,
    Target :-
    Target1(1)
    Target2(2)
    Target3(3),
    Target4(4)
    .
    .
    Target1000(1000)

    How can you achieve this scenario?

    Rv

    • Dec 7th, 2019

    There are thousand rows, who will write thousand different where conditions and then will configure 1000 different files, is there any other solution which dynamic?

    Arshad

    • Apr 9th, 2019

    We can use filter stage which having single input and multiple output. And also allow multiple where conditions.
    Pass the data from each condition to respective output link.
    Ex. Where column_id =1 send that row to target1...

  •  

    Datastage Scenerio

    how i can achieve below logic in datastage
    A B C D
    B C D
    C D
    D

    it can be number and symbol also
    1/2
    /2
    2

    SaravanaKumar

    • Jul 27th, 2019

    Let assume the input file has one column and the value is "ABCD"
    Seq file --> Transformer --> Seq File

    In Transformer Create Two stage variable
    Len(Inut_Field) -> stageVar
    StageVar + 1 -> StageVar1

    Under looping give the iteration as @ITERATION

  •  

    Compile Source Records

    I have 10 Million records in source and target 5 million records were populated then job was aborted again i go and compile and run the job when that time job will run from 5million 1 record to remain records how?

    Hari

    • Mar 9th, 2019

    Use Upsert function in database connector stage. Or use lookup stage to perform lookup on the source and reference as your target data and load into your target stage

  •  

    Convert 1 file into 3 files

    Details:
    Col
    -----
    C1
    C2
    C3
    C4
    C5
    C6
    C7
    C8
    C9
    C10

    we want to generate output like:
    Col1 Col2 Col3
    C1 C2 C3
    C4 C5 C6
    C7 C8 C9
    C10

    Can anyone please help me on this scenario?

    Hemant

    • Mar 4th, 2019

    Use below constraints in xfm to move the data into 3 different columns. Make the xfm partition to run sequential.
    mod(@inrownum,3) = 1
    mod(@inrownum,3) = 2
    mod(@inrownum,3) = 0

    This will move first record to first output file, second to second and third record to third reference link.

    prashant

    • Nov 25th, 2018

    Partion by Range

  •  

    Datastage job scenario question

    My input has a unique column-id with the values 10,20,30.....how can i get first record in one o/p file,last record in another o/p file and rest of the records in 3rd o/p file?

    Prashant

    • Nov 25th, 2018

    If your output file is sequential file then you can you use filter property .

    Prashant

    • Nov 25th, 2018

    If the input has 2 partion then i would get 2 rows for lastrow() function. rest everyhing is correct

  •  

    Load Different Data Files in Single Target Table

    How to load the different data files in single target table using one data stage job? Files are having different name and data but target table in static.

    Hemant

    • Nov 17th, 2018

    If the input file has same metadata and matching file name pattern, then 1. Set Sequential file Read method property to "File Pattern" 2. Provide File Pattern Else, if different file name, then sp...

    Lokeswar Perugu

    • Jun 18th, 2018

    You can write a multi instance job. And parameterise the file name..by keeping table name constant..

  •  

    How to count the records except header and footer in a sequential file

    I have a sequential file it is having some records and the same file is having header and footer now my question is how to count the records in a file which is not counts the header and footer records and then transform the records in to target and then again we fetch the header and footer to that file which records are matched with the header

    Sasidhar Punna

    • Oct 24th, 2018

    Cat | sed 1d ; $d | wc -l

    sed 1d --- for removing 1st row
    sed $d ---- for removing last row

  •  

    How to get top five rows in DataStage?

    How to get top five rows in DataStage? I tried to use @INROWNUM,@OUTROWNUM system variables in transformer..but they are not giving unique sequential numbers for every row...please help!

    Thanks in advance!!

    ravisankar

    • Sep 24th, 2018

    Also you can get form sequential file (Read first row (5))

    lalit

    • Oct 9th, 2017

    If you want to use transformer only so you need to sort that data first....and after that you need to know how many no. of partitions you have in your transformer stage. Because @inrownum and @outrown...

  •  

    1 input file with 100 fields, Load 1st field to 1st target and so on...

    Input file contains 100 fields, target is
    1st field is load into Target 1
    2nd field is load into Target 2
    3rd field is load into Target3
    -----
    -----
    100th field is load into Target100
    How can achieve this scenario ?

    Amit Kumar

    • Sep 18th, 2018

    Step 1: take the columns names in a col_lits.txt file. $head -1 file_name > col_list #IFS="," (say the file was a comma seprated file or if other than , can use tr "other delimiter" ,) for colnm in...

    Gurpreet singh

    • Apr 5th, 2018

    Create 100 target with that one field in DML. Then use a reformat having input file and map each field to target as per requirement.

  •  

    What about System variables?

    sangam

    • May 23rd, 2018

    Out of all those , i am not able to find/call them in a transformer , like @LOGNAME , while i use this in a stage variable, it throws error , saying its not defined. I am using Datastage 11.5 version. Any idea how to get this done ?
    Thanks !

    rameshkm

    • Apr 15th, 2009

    The variables which used in through out the system not in singale project is called System variables .some of the system variables are  @FALSE,@PARTITIONNUM ,@NUMPARTITIONS,@TRUE, which are avaialable in Transformer

  •  

    Single Datastage Job Different Output

    I have to design a job, if I run the job it should get 10 records from emp, if another person runs he should get all the records form emp. How to design such a job?

    Shaktimaan

    • May 2nd, 2018

    If you are using Sequential file stage, there we have an option "Read the first row", make it parametrized.
    and pass the value to the job using dsjob command as the parameter. also, you may like to use Invocation ID as you need to run the job with the different instances.

  •  

    Which partition we have to use for Aggregate Stage in parallel jobs ?

    Anjaneyulu Pagadala

    • Mar 15th, 2018

    Hash partitioning and in link sorting on grouping keys give better performance and correct results if it is in parallel mode and Auto partition will give correct results if there is no sorting happened only one of the keys we are grouping in previous stage

    yassine

    • Jul 12th, 2017

    Hello Harish I would like to ask you a question How I can choose the appropriate partition for each stage and job how can I analyse situation
    thank you

  •  

    How to remove reverse duplicates in datastage ?

    Scenario:
    Objective: The interface aims to consolidate the round-trip ticket cost of passengers.
    Description: The source file is a .txt file, train_route_src.txt, consolidated with trains from a particular source to destination. There are many repetitions in the source file (Reverse Duplication: eg. BLR --> BBS and BBS --> BLR). Remove the reverse duplicates and maintain the target in...

    Bhargav

    • Mar 2nd, 2018

    I don't think you got the output for city in the format of SRC1-DES1-SRC1 (I mean two city names)? I tired your way but didn't get the expected output.

    Alam

    • Feb 15th, 2018

    Ans--> Seq_File------>Sort------>Filter------->Seq_file
    Sort Stage--->Generate key change column(it return for first value 1 and for duplicate 0) then used filter stahe
    Filter Stage----> Filter by Key change column=1.
    I think you will get the result.

  •  

    Load 1 input column values (with delemeter) into different target columns

    I have column X which having 3 values A;B;C. How can I load these values into 3 diff cols in the target. If tomorrow I will receive 100 values for same single column I will load into 100 target cols respectively (Same de-limiter) ?

    Roopa

    • Mar 2nd, 2018

    Using Field function. Field(column,delimeter,1) and so on

    ABACHREK

    • Mar 3rd, 2017

    Loop through the incoming field using looping functionality in transformer. Extract the individual values using field function and the iteration number. Output the individual values to the output link...

Showing Questions 1 - 20 of 736 Questions
First | Prev | Next | Last Page
Sort by: 
 | 
Jump to Page: