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
Routines - Which can read Seq File and Update the same
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3
- Joined: Tue Jun 19, 2007 3:06 pm
Routines - Which can read Seq File and Update the same
Naresh Buch
DataStage -Consultant
DataStage -Consultant
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?
Or are you using a mix of DataStage Sequence job / Shell script / DataStage BASIC code?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3
- Joined: Tue Jun 19, 2007 3:06 pm
How to Read Seq file using DS Routine
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
DataStage -Consultant
Now that the language or method is established, which part specifically are you having trouble with?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3
- Joined: Tue Jun 19, 2007 3:06 pm
I know bit of Basic Looking for Basic Help in Manual My file will be like thisArndW wrote:Now that the language or method is established, which part specifically are you having trouble with? ...
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
DataStage -Consultant
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Routines - Which can read Seq File and Update the same
i have not used this but you can try using WRITEU or WRITEVU.