hHow to run .bat script

Posted by Aleramo on 12-Mar-2014 04:11

Hello, i have a problem, i have to create a script in Progress 9, to run in batch mode i mean with a file .bat. This script has the task to run every day, to save in a csv file the record modified in the day.

How can i run this .bat file?

All Replies

Posted by Dileep Dasa on 12-Mar-2014 04:14

You can use OS-COMMAND() to run .bat files.

This statement escapes to the current operating system and executes the given command/file

Posted by Aleramo on 12-Mar-2014 04:26

Maybe i wrong to explain me, i have to create a .bat to call a file .p or .r to with a short Progress script, if i do not wrong with OS-COMMAND i leave a Progress session to call a .bat file, while i have to do the opposite. I want to schedule in Windows a .bat script to call a .r or .p.

Posted by James Palmer on 12-Mar-2014 04:29

I use something like this:

SET dlc=c:\progress\openedge

path=%path%;c:\progress\openedge\bin

start C:\Progress\OpenEdge\bin\_progres -b -basekey "INI" -ini c:\icmas\live\progress.ini -pf c:\batch\ICMASliv.pf -p Userio.p -param 60

Obviously you would need to tweak yours to fit your environment, but it's a start.

Posted by Dileep Dasa on 12-Mar-2014 04:38

In that case, you can write a line similar to this in the .bat file:

$DLC/prowin32 -p yourpfilename.p -b

This will execute the given .p file

Posted by Aleramo on 12-Mar-2014 05:03

Thank you very mich, it works, but i had to delete $DLC/ from the string. What does $DLC mean? What is the meaning of prowin32 command and -b parameter?

Thank you to everybody!

Posted by Dileep Dasa on 12-Mar-2014 05:19

$DLC is generally used to denote the OpenEdge install directory. If $DLC is in your PATH, you need not write it.

prowin32 invokes a new Progress client and "-b" is used to to initiate a batch session with no terminal interaction.

Posted by Aleramo on 12-Mar-2014 05:22

Thank you very much! We can conside the post closed.

Posted by Aleramo on 12-Mar-2014 11:15

Just one question, because i tried to connect to DB by code, but i always get message "DB sociale not connected". How can i do connection to DB by code? I tried with statement:

CONNECT E:\PROGRESS\SISS\Test\db\sociale.db -1.

i give DB directory and single user connection, but i get message:

E:\IeT\import-SI.SS\UpdateAnCli00F.p Database sociale not connected. (1006)

How can i solve the problem? Do you think DB miss some parameters?

Thank you to everybody.

Posted by James Palmer on 12-Mar-2014 11:22

If you look at the example I gave you supply the startup with a pf file. This will have your db connection stuff in it. You are much better off using that than code. Particularly as it is likely the code you are using contains db references which will mean it won't run with no dbs connected. TO connect dbs programmatically you would need to connect them in one .p and then run the other from within that program.

Posted by Dileep Dasa on 12-Mar-2014 12:19

Please check for errors in sociale.lg file.

You can also use "-db" startup parameter to connect to a database as an alternate. For example:

prowin32 -p mydotp.p -db mydb -1

Posted by Aleramo on 13-Mar-2014 04:01

I thank you very much both, because it works if i give directly -db parameter or i use -pf parameter with file, and i used the parameter file of application, but it has a lot of parameters, for example:

-T Temp

-inp 16384

-s 200

-debugalert

-p _ab.p

where can i find the meaning of this parameters? and in particular, what is the meaning of _ab.p file? I find thsi file very often in the code, but i never understood it.

Posted by James Palmer on 13-Mar-2014 04:10

_ab.p is the program that runs the appbuilder. If you want to run a batch script then you'll want to take this line out of the pf you use.

As for the other parameters, I suggest you have a look at the documentation, or talk to some folks you work with who have more experience.

Posted by Aleramo on 13-Mar-2014 04:30

Ok, thank you!

This thread is closed