Using a "" as a parameter from a .bat
Moderators: chulett, rschirm, roy
Using a "" as a parameter from a .bat
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
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
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
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
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
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
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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
Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: