I would like to know whether I could be able to run(or call) Pro IV function directly from the Unix Shell script.
Please quote the answer to this question.

Executing Pro Iv function from Unix Shell Script
Started by
Guest_Vidyanand_*
, Aug 23 2001 04:15 AM
3 replies to this topic
#2
Posted 23 August 2001 - 05:47 AM
The traditional method of doing this is as follows:
Set up a PRO-IV User (e.g. EXE) that has a logon link function of a function you create (e.g. RUNFUN) and doesn't require a logon.
RUNFUN should have the following code as a minimum:
XFERIN($FUNCTION)
@LFUNCT = $FUNCTION
Then you can call this from the shell:
pro EXE MDC xxxxxxxx
This will load PRO-IV, execute the RUNFUN function which then calls your specified function.
Notes: you need to make sure that the function you call knows to exit to OFF (or an exit function if SL) if called in this way (you could always ENABLE one of the bit flags in RUNFUN to indicate this).
You could also enhance the RUNFUN to let you pass other variables which RUNFUN could load into COM variables etc.
Set up a PRO-IV User (e.g. EXE) that has a logon link function of a function you create (e.g. RUNFUN) and doesn't require a logon.
RUNFUN should have the following code as a minimum:
XFERIN($FUNCTION)
@LFUNCT = $FUNCTION
Then you can call this from the shell:
pro EXE MDC xxxxxxxx
This will load PRO-IV, execute the RUNFUN function which then calls your specified function.
Notes: you need to make sure that the function you call knows to exit to OFF (or an exit function if SL) if called in this way (you could always ENABLE one of the bit flags in RUNFUN to indicate this).
You could also enhance the RUNFUN to let you pass other variables which RUNFUN could load into COM variables etc.
#3
Posted 23 August 2001 - 01:47 PM
You could also use the PROIV task feature which I think you may have to buy separately. This allows you to share variables between functions and link them in an organized fashion. I would only recommend this if you are doing complicated tasks as you can do the call as Chris says.
#4
Posted 24 August 2001 - 12:33 PM
Attached is a Word document I created in 1997 to present at the Glovia User Group. It details how to run MRP in Glovia from a Unix Shell script. I still use the same procedure to schedule any Pro-IV function I want to automate. Basically you run the pro MDC SYS (or whatever login you choose) and redirect the stdin using the unix redirector '<<' (see the man page for your favorite shell for an in depth discussion). Now that I have a shell script I can execute that from cron which is still my favorite scheduler due to the awesome power and simpleness (I'm quite simple-minded).
Just thought I'd throw this out there as an option.
- Scott
Just thought I'd throw this out there as an option.
- Scott
Attached Files
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users