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 Posted / prabhu

source->sortstage->removeduplications->dataset

in sortstage->create key changecolumn=true
after
removeduplicates stage->duplicates retain:-last
we can get last and first record group wise.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are data elements?

667


CHANGE CAPTURE

902


In Informatica,for the table I can find coreesponding dependent mappings.Likewise can I find the dependent jobs with all the information by using the table name

2021


Explain entity, attribute and relationship in datastage?

645


what is the use of surogate key in datastage

1830






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 − min_lvl between 0 and 25 inclusive. − Same column types and headings as Jobs.txt. − Include column names in the first line of the output file. − 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 − min_lvl between 26 and 100 inclusive. − Same format and derivations as Target file 1. • Target file 3: HighLevelJobs.txt − min_lvl between 101 and 500 inclusive. − Same format and derivations as Target file 1. • Rejects file: JobRejects.txt − min_lvl is out of range, i.e., below 0 or above 500. − This file has only two columns: job_id and reject_desc. − reject_desc is a variable-length text field, maximum length 100. It should contain a string of the form: “Level out of range: ”, where is the value in the min_lvl field. My Question is how do you write the stage variable for reject rows.

2203


Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC

977


Name the command line functions to import and export the DS jobs?

717


Where the datastage stored his repository?

630


AGGREGATOR default datatype

943


How can you write parallel routines in datastage PX?

628


Where do the datastage jobs get stored?

741


whom do you report?

1512


What is the Environment Variable need to Set to TRIM in Project Level?(In transfermer, we TRIM function but I need to impliment this project level using Environment variable)

1905


How to create a file using vi editor? 2)how to delete a file in vi editor? 3)How to connect the server datastage to unix? what r the command lines we r using? 4)30 jobs r runnig in unix i want to find out my job. how to do this? give me command?

2060