Routines - Which can read Seq File and Update the same

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
nareshbuch
Participant
Posts: 3
Joined: Tue Jun 19, 2007 3:06 pm

Routines - Which can read Seq File and Update the same

Post by nareshbuch »

I am new to Routines I would like to achieve folloing things

1. I have one Seq. file which will be used to control my main loop
2. I will read this file
3. Enter into another sub loop
4. Check some arrival of files in my Unix Folder
5 Check that FTP is complete
6 com out of this loop
7 Update pointer in SEQ file with staus 'File Arrived '
8. Go to another record in SEQ file
9. Complete the reading of Seq file and check all file has arrived or not

I have written sub loop logic but I am trying to find reading of seq file and updating the same
Naresh Buch
DataStage -Consultant
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Did you code the sub loop logic in C++? Since you posted in the PX forum that would be my assumption so your other logic would have to be written in C, and there are other forums that can help you with that code.

Or are you using a mix of DataStage Sequence job / Shell script / DataStage BASIC code?
nareshbuch
Participant
Posts: 3
Joined: Tue Jun 19, 2007 3:06 pm

How to Read Seq file using DS Routine

Post by nareshbuch »

ArndW wrote:Did you code the sub loop logic in C++? Since you posted in the PX forum that would be my assumption so your other logic would have to be written in C, and there are other forums that can help you with that code.

Or are you using a mix of DataStage Sequence job / Shell script / DataStage BASIC code?

I use Mix of of DataStage Sequence job / Shell script / DataStage BASIC code and unix command to capture the value.
Naresh Buch
DataStage -Consultant
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Now that the language or method is established, which part specifically are you having trouble with?
nareshbuch
Participant
Posts: 3
Joined: Tue Jun 19, 2007 3:06 pm

Post by nareshbuch »

ArndW wrote:Now that the language or method is established, which part specifically are you having trouble with? ...
I know bit of Basic Looking for Basic Help in Manual My file will be like this
Recno,Source,no of Files to Receive
001 ,SAP , 13
002 ,SIEBEL, 01
What I am goin to do is read this file in routine get the value like
Which Source and how many files

go to folder in unix
issue wc -l command get the value of how many files received so far
if received update file last field as 'FTP REceived'
go to Next in SEQ file

How can i get the value in varibale from file
Naresh Buch
DataStage -Consultant
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OpenSeq, ReadSeq, WriteSeq and CloseSeq are the BASIC statements for working with line-based text files. However, you can't update. Instead you could open the parent directory as a table and read the file as a "record" whose "key" is the file name. The variable into which you read the file is a dynamic array delimited by field marks. In this case the statements are OpenPath, ReadU, WriteU and Close for working with the file and Field() and FieldStore() functions will allow you to read and update an individual line. Research these in the DataStage BASIC manual or on-line help.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Routines - Which can read Seq File and Update the same

Post by sachin1 »

i have not used this but you can try using WRITEU or WRITEVU.
Post Reply