Using Windows System Variables inside Before/After routine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Using Windows System Variables inside Before/After routine

Post by ggarze »

Is there a way inside a Before/After routine to retrieve a Windows system variable, not a DataStage variable, but a system variable defined on the Windows server?

Thanks
ggarze
Premium Member
Premium Member
Posts: 78
Joined: Tue Oct 11, 2005 9:37 am

Post by ggarze »

I actually figured it out. If anyone else needs it you use:

Call DSExecute('DOS', "Echo %WIN_VARIABLE%", return_value, return_code)

The return_value does have a none viewable character at the end so you'll need to leve that off, especially if you are using it as a file path.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The non-viewable character is the line terminator, converted to a field mark.

Code: Select all

Call DSExecute('DOS', "echo %WIN_VARIABLE%", return_value, return_code) 
Result = Convert(@FM, "", return_value)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply