How Fetch the Records....

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
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

How Fetch the Records....

Post by naveen19 »

Hi Folks,

I have Requirement, i have to fetch two column records from the database(DB2) and write that into a dataset by using Shell Script or Routines.... is it possible..

Thanks in Advance

Regards
Naveen.K
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, it is possible. I am not going to ask you why you aren't doing this in a DataStage job as you have hopefully thought of that.

You can execute a shell program and do your DB2 connect and query routines from there.
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Post by naveen19 »

ArndW wrote:Yes, it is possible. I am not going to ask you why you aren't doing this in a DataStage job as you have hopefully thought of that.

You can execute a shell program and do your DB2 connect and query ...
Hi Arndw,

Thanks for ur reply, can u share any of the scripts or any tips to do that,so that it will be very helpful for me

Regards
Naveen.k
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Naveen,

what have you tried so far?

p.s. "ur" and "u" are not valid forms of "your" and "you"; this isn't an SMS site.
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Post by naveen19 »

ArndW wrote:Naveen,

what have you tried so far?

p.s. "ur" and "u" are not valid forms of "your" and "you"; this isn't an SMS site. ...
i have retrieved the data from db2 with help of the script, and i dont how to write in the Sequential file or dataset..

p.s. you can stopped by saying "ur" and "u" are not valid forms of "your" and "you"; and not "this isn't an SMS site. ..."
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Post by naveen19 »

ArndW wrote:Naveen,

what have you tried so far?

p.s. "ur" and "u" are not valid forms of "your" and "you"; this isn't an SMS site. ...
i have retrieved the data from db2 with help of the script, and i dont how to write in the Sequential file or dataset..

p.s. you can stopped by saying "ur" and "u" are not valid forms of "your" and "you"; and not "this isn't an SMS site. ..."
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The script can write straight to a sequential file by you cannot do that to a dataset. If you need to write into a dataset then you should do everything in a job DB2 -> DataSet.
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Post by naveen19 »

ArndW wrote:The script can write straight to a sequential file by you cannot do that to a dataset. If you need to write into a dataset then you should do everything in a job DB2 -> DataSet. ...

Can you provide any sample script which will help me a lot which writes that data directly to sequential file


Regards
Naveen.K
naveen19
Participant
Posts: 52
Joined: Tue Mar 06, 2007 9:08 am
Location: India
Contact:

Post by naveen19 »

ArndW wrote:The script can write straight to a sequential file by you cannot do that to a dataset. If you need to write into a dataset then you should do everything in a job DB2 -> DataSet. ...

Can you provide any sample script which will help me a lot which writes that data directly to sequential file


Regards
Naveen.K
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Naveen - I am confused. You stated that you have written a script to retrieve the DB2 data; just add a redirector such as ">> textfile.txt" in order to create a sequential file from the output.

Are you sure you wish to make it complicated and use a script and not do this in DataStage job with just 2 stages?
Post Reply