Exec Dos Command
Moderators: chulett, rschirm, roy
Exec Dos Command
Hi there
I have to exec a Dos command in the before routine as this:
"Echo 2006/03/20 > pippo.dat"
to create a flat file at the end of this job, if it run without errors. In this file I have to insert only one row with the current data, as for example "2006/03/20". How can I do that? I can put the current date in the command, using for example, the DataStage variable @date? I know I can use a parameter contained the current date but I'ld know if there is a direct method to do that without using parameters.
Thank you
Umberto
I have to exec a Dos command in the before routine as this:
"Echo 2006/03/20 > pippo.dat"
to create a flat file at the end of this job, if it run without errors. In this file I have to insert only one row with the current data, as for example "2006/03/20". How can I do that? I can put the current date in the command, using for example, the DataStage variable @date? I know I can use a parameter contained the current date but I'ld know if there is a direct method to do that without using parameters.
Thank you
Umberto
Umberto,
I am not sure about what you need to do; you posted the question as a UNIX server one, but are asking about DOS; you stated that you want a "before routine" to do something after the job completes successfully.
If you has a DOS server installation, you can simply execute as a shell command to put the current system date into a file.
I am not sure about what you need to do; you posted the question as a UNIX server one, but are asking about DOS; you stated that you want a "before routine" to do something after the job completes successfully.
If you has a DOS server installation, you can simply execute
Code: Select all
date /t > pippo.dat
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A similar approach for UNIX also involves the date command; the picture option is set according to your requirements. For example
But, as Arnd noted, we are not sure whether you are asking about UNIX (your job type in post header) or DOS (your post body).
Code: Select all
date +"%yyyy-%MM-%dd" > bippo.dat
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.
Ok, it works. Thank you very much. I did it in a Unix environment with touch command. Now I work in a Windows 2003 Server and I don't know the Dos Command.ArndW wrote:Umberto,
I am not sure about what you need to do; you posted the question as a UNIX server one, but are asking about DOS; you stated that you want a "before routine" to do something after the job completes successfully.
If you has a DOS server installation, you can simply executeas a shell command to put the current system date into a file.Code: Select all
date /t > pippo.dat
Thank you again to everybody
Umberto
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is the command I used in a Unix environment. I can't access this subdirectory. I have decided to use the command suggested "date /t > filename.dat". If I want to write in that flat file the current date and time?ray.wurlod wrote:touch.exe ships with DataStage. It can be found in the Engine folder's bin subdirectory. ...
Thank you
Umberto
Umberto,
just as with date /t you can use the time /t command to get the current time output in dos.
just as with date /t you can use the time /t command to get the current time output in dos.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Try "echo %DATE% %TIME% > filename.dat"
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>