Exec DOS questions

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
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Exec DOS questions

Post by snassimr »

Hi everybody !!!

If I can to execute DOS script containing some rows of code with DSExecute function and how to concenate the rows ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use DSExecute with the first (Shell) argument set to "DOS".
The third argument contains the output. All of the output, with each line returned as a field in a dynamic array.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Post by snassimr »

I asked about input DOS line . It contains for rows of code :

open 23.23.23
user ert ert
quote rcmd

It just a sample . I want to send all of these comand with one DSExecute and get one output.

The qiestion is how to send some commands with DSExecute ?
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Write a batch file, which would have all the codes required for and execute the batch file using DSExecute.

HTWH.

Regards
Saravanan
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Post by snassimr »

I want to do it without batch file
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Why can't you use a batch file? A solution given in this site is based upon the information you provide.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
You might be able to do it with the ftp stage using the telnet options.
Beyond that why are you relactant to use a batch? (you can build it on hte fly using a ds job if that is what your worried about.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
kerensho
Participant
Posts: 13
Joined: Mon Jul 11, 2005 5:36 am

Post by kerensho »

Hello,

You have two options:
1. a batch file
2. a routine

if you'll need to write multiple lines in the ExecSH often, I suggest write a generic routine that gets all the code as one string parameter with a delimiter between the lines. in the routine open a loop that reads and executes field by field (ie line by line).

good luck,
Keren
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Post by snassimr »

(you can build it on hte fly using a ds job if that is what your worried about.

How ?

I dont approved to put bat files on server of my source.
I need to use only DS tools . How I can to build somthing that the result is exactly from running bat file.
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

As Keren mentioned, you can have all the statements in a sequential file, you can read the sequential to get the command and gets executed using DSExecute.

You need to read this file and execute this statement in the loop.

HTWH.

Regards
Saravanan
snassimr
Premium Member
Premium Member
Posts: 281
Joined: Tue May 17, 2005 5:27 am

Post by snassimr »

If I can to concenate the commands ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, with field marks (@FM) between them. In this way you have constructed a dynamic array, in which each element will be interpreted as a separate line by the shell.
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