Executing a command from the dos shell using the before subr

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Executing a command from the dos shell using the before subr

Post by admin »

This is a topic for an orphaned message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Simon,

That error message normally indicate that your path to execute the perl script is not configure properly. If Perl is configured right, you should be able to type perl script.pl in a command prompt and have the script run. If not, you need to reinstall perl and check the path statement to make sure perl.exe is included( path environment). If this works you should also be able to double click on a script file (extention .pl) and have it run. If not you need to create an association for .pl and perl.exe (wherever it located).

Check the path of your computer to make sure that perl is included. To check the path: -Go to a command prompt -Type the following: path Your computer will return the contents of the path, which should include the directory for perl. If it does not, you must add it.

Setting the Path for Perl: Windows
To set the path for perl (Windows):


1. Click on Start.

2. Select Control Panel.

3. Select System.

4. Select Advanced.

5. Select Environment Variables.

6. In the lower box, double click on Path.

7. Add ;C:perlbin (if that is the directory where perl is installed) to the path. Note that you must use a semicolon to separate the values. the directory for perl, using a semicolon (;) to separate it from other values.

You may also set the path for perl via the command line. Type path= and then retype the contents of your path query, but add the directory for perl.



Example:

If the path command returned this

path=C:WINNTsystem32;C:WINNT

you would type

path=C:WINNTsystem32;C:WINNT;C:Perlbin

if C:Perlbin is where perl is installed.


Kent McLeod

P.S. Im not actually supporting this product for ascential software anymore
----- Original Message -----
From: "Simon Vollett"
To: "datastage"
Sent: Wednesday, October 10, 2001 5:40 PM
Subject: Executing a command from the dos shell using the before subroutine option


> Hello all,
>
> I am trying to use the before job subroutine ExecDOS to run a perl
> script
to
> tidy up an input file prior to processing it. I get the following
> error
> message:
>
> pabx.BeforeJob (ExecDOS): Error when executing command: perl
> C:perlscriptsPABX_to_csv.pl
> *** Output from command was: ***
> perl is not recognized as an internal or external command, operable
> program or batch file.
>
> I try writing a batch file test, which contains perl
> C:perlscriptsPABX_to_csv.pl and I get the following error message:
>
> pabx.BeforeJob (ExecDOS): Error when executing command: "test.bat"
> *** Output from command was: ***
> pabx.bat is not recognized as an internal or external command,
> operable program or batch file.
>
> Anyone have any ideas why the command is not recognised?
>
> Thanks in advance,
>
> Simon Vollett
>
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

The directory containing the perl executable and the pabx.bat file are not accessible via the PATH environment variable.

-----Original Message-----
From: Simon Vollett [mailto:svollett@comdyn.com.au]
Sent: Wednesday, 10 October 2001 17:40
To: datastage
Subject: Executing a command from the dos shell using the before subroutine option


Hello all,

I am trying to use the before job subroutine ExecDOS to run a perl script to tidy up an input file prior to processing it. I get the following error
message:

pabx.BeforeJob (ExecDOS): Error when executing command: perl C:perlscriptsPABX_to_csv.pl
*** Output from command was: ***
perl is not recognized as an internal or external command, operable program or batch file.

I try writing a batch file test, which contains perl C:perlscriptsPABX_to_csv.pl and I get the following error message:

pabx.BeforeJob (ExecDOS): Error when executing command: "test.bat"
*** Output from command was: ***
pabx.bat is not recognized as an internal or external command, operable program or batch file.

Anyone have any ideas why the command is not recognised?

Thanks in advance,

Simon Vollett
Locked