How to find EOF using DataStage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
How to find EOF using DataStage
Hello All,
Can you please tell me, whether there is any inbuilt function or routine in DS to find the end-of-file. Currently I am not able to find an economical way.
I am using ExecDOS before stage subroutine and calling a batch file that finds the EOF, also it is doing same in Command Stage, but the problem is, how can I use the output of this DOS command in my transformer.
For e.g. I have to find the EOF and then in the next line I have to insert some identification flag. so that when next time the data gets appended to this file, I'll be using the flag to define the constraints in the transformer.
Can you please tell me, whether there is any inbuilt function or routine in DS to find the end-of-file. Currently I am not able to find an economical way.
I am using ExecDOS before stage subroutine and calling a batch file that finds the EOF, also it is doing same in Command Stage, but the problem is, how can I use the output of this DOS command in my transformer.
For e.g. I have to find the EOF and then in the next line I have to insert some identification flag. so that when next time the data gets appended to this file, I'll be using the flag to define the constraints in the transformer.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
The normal method of reading a sequential file in a DataStage job does not let you append a row easily using that methodology.
This can be done with a simple command at DOS or UNIX, you can also open and append data to a sequential file from inside a DataStage routine (using OPENSEQ and SEEK)
This can be done with a simple command at DOS or UNIX, you can also open and append data to a sequential file from inside a DataStage routine (using OPENSEQ and SEEK)
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
I have tried a similar approach like calling the command in command stage and then the COMMANT.OUTPUT value of command stage is fed to transformer directly.DSguru2B wrote:Run the OS level command using DSExecute() in a routine. Reference that routine inside the transformer.
It is throwing an error of Command not recognized as internal or external command. But when i run the same command from DOS prompt, it works fine. Is it like DS supports a particular version of DOS
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
-
- Participant
- Posts: 221
- Joined: Fri Feb 17, 2006 3:38 am
- Location: India
- Contact:
Hi,chulett wrote:No, it just leverages whatever it is you got. Post your command. ...parag.s.27 wrote:Is it like DS supports a particular version of DOS
I am using the command as
Code: Select all
cd\
FIND /N /C "WRI001" c:\Parag\sage_dovegate_inddata_sales_ledger.rpt >> c:\Parag\cmdout.txt
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
Parag Saundattikar
Certified for Infosphere DataStage v8.0
-
- Premium Member
- Posts: 273
- Joined: Wed Oct 18, 2006 12:20 pm
- Location: Porto
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not a good solution, because the file variable that you SEEK to eof only has scope within the routine. The OP's requirement was to "find" eof (whatever that means - I have no idea). You could get the size of the file (from DIR) and use that, I guess, as the address of EOF. But what purpose will it serve?
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.