Applying Loop in Datastage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
tech_savvy
Participant
Posts: 48
Joined: Mon Oct 08, 2007 7:12 pm
Location: Sydney

Applying Loop in Datastage

Post by tech_savvy »

Hello,

I have an requirement where i need to apply loop,
Can it be done through datastage Enterprise edition.

Thanks in Advance,
Regards
Naveen Kandukuri
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your requirement is too vague.

Every DataStage job is inherently a loop over all records in its source.

What do you mean more specifically?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tech_savvy
Participant
Posts: 48
Joined: Mon Oct 08, 2007 7:12 pm
Location: Sydney

Post by tech_savvy »

Hello,

My requirement is that each row in a file will be a single file at the output, If there are 30 rows in the output i am expecting 30 files.
Please suggest me the best way for this approch.

Thanks
Regards
Naveen Kandukuri
BugFree
Participant
Posts: 82
Joined: Wed Dec 13, 2006 6:02 am

Post by BugFree »

One row per file? I think it will be easier in command. Process the data in your job and write it to a file and then split the file using windows command.
Ping me if I am wrong...
Rubu
Premium Member
Premium Member
Posts: 82
Joined: Sun Feb 27, 2005 9:09 pm
Location: Bangalore

Post by Rubu »

I agree with BugFree. why would one want to add overload by creating a job for such a task.

BTW, just curious, why do you actually need to do such a thing?
Regards
Palas
Rubu
Premium Member
Premium Member
Posts: 82
Joined: Sun Feb 27, 2005 9:09 pm
Location: Bangalore

Post by Rubu »

I agree with BugFree. why would one want to add overload by creating a job for such a task.

BTW, just curious, why do you actually need to do such a thing?
Regards
Palas
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

I have posted a parallel routine which exactly does what you need. You can find the solution in THIS post.

Main highlights of this C++ function are:
-->Creates and writes on a text file for each record.
-->You can dynamically pass your file path, file name and extension and also the records to be written into the file.
-->Records can be of different metadata.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
tech_savvy
Participant
Posts: 48
Joined: Mon Oct 08, 2007 7:12 pm
Location: Sydney

Post by tech_savvy »

Hello Jose,
Thanks for your reply, The solution page U have given is not opening I think the page might have been expired.
Please send me other link

Thanks in advance
Regards
Naveen Kandukuri
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'd use a server job and write to a Type 19 hashed file. Only 30 lines - sheesh! The server job would be done before the parallel job had even gotten started.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

OP didn't say only 30 rows :wink:
Can't see Jose or U's post in this thread :?
tech_savvy wrote:If there are 30 rows in the output i am expecting 30 files.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Wanna race? Any N (identically structured) rows up to 10 million.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Upto 10 million!! Love to race!
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

tech_savvy wrote:Thanks for your reply, The solution page U have given is not opening I think the page might have been expired.
The link is fine. You're probably logged in to 'dsxchange.com' and he linked to 'www.dsxchange.com'. Copy the link, paste it into the address bar and remove the www, see if it works then.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply