Using a "" as a parameter from a .bat

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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Using a "" as a parameter from a .bat

Post by gpbarsky »

Hi forumers.

I am building a .bat file, in order to invoke (via dsjob) a Start job. This Start job has several parameters, and one of them is a path. As every path, it has several "" within the string. I this way, I got an error message, saying that invalid parameters were passed. The Start job was not started.

I replaced the "" by "" and it worked. But I don't know exactly how the "" behaves within the DataStage job.

Could somebody tell me if it is correct what I did, replacing the "" with "" in the .bat file ? Is there any other way to pass a path as parameter, from a .bat file to a DataStage job ?

Thanks in advance.

Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

If you in DOS or // in UNIX it does not change anything. I suspect that DOS is not allowing to go through without validating the path. It is very critical in UNIX to quote strings with / in them. This would probably work with quotes around it as well.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kim:

Thanks for your answer.

My DataStage 5.2 is over a Windows platform. And I don't understand what you said me about "...work with quotes around it as well...".

Can you explain me ?

Thanks, again.


Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

You are running dsjob with Param1=dir1file1 and it does not work. You changed it to dsjob Param1=dir1file1. Try dsjob Param1='dir1file1'.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kim:

This is the invocation that I am executing, from within the .bat file:

E:ascentialdatastageenginebindsjob -run -mode NORMAL -param pmMandante="221" -param pmHost="10.250.0.20" -param pmDriveEjecucion="E:" -param pmPathBase="AscentialDataStagePublicoOSDE" -jobstatus PROAC-COBRANZAS-D StartCobranzas.221

This is working now. The only thing that it is not working is that at the end of each job I make a "delete" command to delete all files generated by the job.

The delete receive as parameter the path and the expression to delete (something like p*). This is failing because of the "".

In all of the other jobs, I can see in the logs that the "" is handled without any problem.

Thanks for your cooperation.


Guillermo P. Barsky
Buenos Aires - Argentina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Backslash followed by another character has a special meaning to the DOS shell. For example n is a newline, t is a horizontal tab. For this reason, the special construct means "a single backslash". It you don't do this, the shell will attempt to treat the backslash and following character as special. A is "alert" (the terminal bell).

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Also in the UNIX world where it is used to "escape" or turn off a metacharacter. For example, a character than means something special in UNIX, like a tilde for example, needs to be escaped if you want to search for (or use) that literal character.

-craig
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That can be a vital piece of knowledge for those on UNIX, particularly for things like cd &PH& ("escaping" the ampersand characters so that you don't go starting erroneous background processes. An alternative is to enclose the entire filename in "hard quotes" (single quote characters), for example cd '&PH&'.
However, the OP specified a .BAT file which is a rare beast indeed in the UNIX environment (in my experience, anyway!). [8D]

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Jeez, Ray... pick, pick, pick. [;)]

Just trying to expand a little on the topic at hand. Besides, Kim brought UNIX into the picture first.

-craig
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yeah, me too. Hence the [8D] - alas, the software moved it onto a line by itself, so it wasn't so obviously related to the text.
Post Reply