| |
GeekInterview.com > Tech FAQs > DataStage
| Print | |
Question: in datastage how we can do for this type or requirement:
The sales data will be extracted in 2 flat files. Here is the codification suggested:
SALE_HEADER_XXXXX_YYYYMMDD.PSV SALE_LINE_XXXXX_YYYYMMDD.PSV
XXXXX = LVM sequence to ensure unicity and continuity of file exchanges Caution, there will an increment to implement. YYYYMMDD = LVM date of file creation
COMPRESSION AND DELIVERY TO: SALE_HEADER_XXXXX_YYYYMMDD.ZIP AND SALE_LINE_XXXXX_YYYYMMDD.ZIP
if suppose we run first time means the job names are sale_header_1_systemcurrentdate & sale_line_1_systemcurrentdate. if we run next time means the file name are sale_header_2_systemcurrentdate & sale_line_2_systemcurrentdate. if we run next time means the file names are sale_header_3_systemcurrentdate & sale_line_3_systemcurrentdate.
we want one increment in that xxxxx place .
can any one give suggestion on this issue.?
|
| July 07, 2008 11:39:19 |
#1 |
| Abhijain |
CRM Expert Member Since: December 2007 Total Comments: 13 |
RE: in datastage how we can do for this type or requirement:The sales data will be extracted in 2 flat files.Here is the codification suggested: SALE_HEADER_XXXXX_YYYYMMDD.PSVSALE_LINE_XXXXX_YYYYMMDD.PSVXXXXX = LVM sequence to ensure unicity and continui |
I am not sure will this work or not, I've not tried, but you can check with the looping stage from a sequence.
Call a job activity in a job sequence where you invoke a job to perform the increment operation as per your requirement. Then pass this value to loop activity, where in loop you call the unix script in which you pass this values as parameter and create the file and append the data in that.
The loop activity runs, no. of times you have incremented it.
Logic will looks like....
Sequence---
JobActivity_1 > Loop Start > Call Shell Script > End Loop
JobActivity_1 -- perform the increment logic and passes the incremented value to loop.
Shell Script -- Create a new file with the file name as incoming value and loads the data in it.
Loop Activity -- Runs the loops as per the no. of input values.
|
| |
Back To Question | |