cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduled jobs

Former Member
0 Kudos

Is there a way to invoke a PAS procedure from an external scheduler?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member84747
Participant
0 Kudos

Hi Cliff,

There is no issue at all with doing this. You'd just do something like:

c:\program files\....\pasadmin.exe -u username -p password -j procname

For example

c:\program...\pasadmin.exe -u admin -j batchload.pro

Then in batchload.pro you'd have a USE command, perhaps an ATTACH if you have a library database, and then call the actual procedures that you want to run. The only thing you would want to do here is have the procedure that you're calling one that is sitting in the home directory as you are unable to change PAS models if you call a proc within model.

You'd then put something in the Windows Event Schdeduler to run the executable with the parameters specified.

Hope this helps,

Robert

Former Member
0 Kudos

Cliff - Just adding to Robert's comments:

You would have some *.bat file housing the "C:\Program Files\...\pasadmin.exe -u username -p password -j jobname.proc" command.

If you aren't going to put the jobname.proc file in the home directory, make sure that you update the DBPATH variable in the lsserver.ini file to add the path where the jobname.proc file is located.

You may also want to add the following lines to the *.bat file to ensure that you restart the internet publisher after the data load:

net stop "SAP SSM Extended Listener"

net start "SAP SSM Extended Listener"

SEE FILE CONTENT EXAMPLES BELOW:

--

Example contents of *.bat file:

H:\SAP\SSM\ApplicationServer\PASADMIN.EXE -j jobname.proc;ext -u admin u2013p password

net stop "SAP SSM Extended Listener"

net start "SAP SSM Extended Listener"

pause

--

Example contents of jobname.proc file:

...Turns tracing on so that a log of the routines is created

TRACE

...Set path for trace file so that you can view load results

BOTH 'H:\SAP\SSM\ApplicationServer\data\DataLoads_Backups_Scripts\Scripts\SSM_Refresh_Log.txt'; ext UPDATE

...Kill all open connections to the model

SUP KILL CONN TO <model name>

...Exclusively use model so that no one else can access

USE <model name> Exclusive

...Set Checkpoint to ensure rollback if any procedure fails

CHECKPOINT FREEZE

...Load the data that is refreshed monthly that is located in PAS (job in PAS)

JOB SSM_MONTHLY_LOAD

...Refresh the target data to account for any requested changes (job in PAS)

JOB SSM_TARGET_LOAD

...Update application server as all procedures successfully complete

CHECKPOINT UPDATE

TRACE BOTH OFF

...Exit Application Server

EXIT CLEAR

-


Hope this helps.

Jason

former_member84747
Participant
0 Kudos

Good points Jason.

It makes sense to create a .bat file which calls pasadmin with the appropriate parameters. The NET STOP "SAP SSM Extended Listener" and NET START "SAP SSM Extended Listener" are very important as they will ensure that any client/server connections between the Interactive Publisher component and PAS will be nicely closed - with an EXIT CLEAR in each one.

As for the sample jobname.pro, note that you shoudn't need to do the SUP KILL CONN TO if you have done a NET STOP of the SAP SSM Extended Listener service.

And of course the EXIT CLEAR at the end of the job proc is critical else it won't ever end the pasadmin.exe process.

Thanks,

Robert

Former Member
0 Kudos

Agreed Rob.

However, I would still recommend including the SUP CONN KILL command because based on the control flow within the batch file, this is called before (not after) the NET START/STOP commands.

The purpose of the NET START/STOP commands is to both restart the internet publisher after the state of the dimensional models have changed, and clear any work databases (DB* files) that have accumulated over time.

Former Member
0 Kudos

Thanks guys, That's what I was looking for.

Former Member
0 Kudos

Hello Cliff,

We are using SSM 7.5 and have a scorecard (DCSCORECARDS) in which metrics/measures data is updated from cube by executing procedures (DCB, DCA etc.). The procedures are working fine when executed manually and data is getting updated in scorecard correctly. But I want to schedule these procedures in PAS server so that we need not to manually execute these procedures one by one every time to update the data. To periodically upadate data through procedures, I have created a batch file which is scheduled for daily update at a particular time. This batch file is scheduled through task scheduler in the PAS server with batch job name as SSMUpload_JOB.

The details of batch file are:

Name:

globalworkforce

Location:

E:\Program Files (x86)\SAP BusinessObjects

Content of batch file (globalworkforce):

@echo off
echo set sh=WScript.CreateObject("WScript.Shell") >tmp.vbs
echo WScript.Sleep 300 >>tmp.vbs
echo sh.SendKeys "SSMJOB{ENTER}" >>tmp.vbs
echo WScript.Sleep 1000 >>tmp.vbs
echo sh.SendKeys "trace both 'logfile.txt';ext{ENTER}" >>tmp.vbs
echo WScript.Sleep 3000 >>tmp.vbs
echo sh.SendKeys "SUP KILL CONN DCSCORECARDS{ENTER}">>tmp.vbs
echo WScript.Sleep 50000 >>tmp.vbs
echo sh.SendKeys "USE DCSCORECARDS EXC {ENTER}">>tmp.vbs
echo WScript.Sleep 10000 >>tmp.vbs

echo sh.SendKeys "JOB DCB{ENTER}{TAB}">>tmp.vbs
echo WScript.Sleep 10000 >>tmp.vbs
echo sh.SendKeys "JOB DCA{ENTER}">>tmp.vbs
echo WScript.Sleep 10000 >>tmp.vbs
echo sh.SendKeys "trace both off{ENTER}" >>tmp.vbs
echo WScript.Sleep 3000 >>tmp.vbs
echo sh.SendKeys "USE ZTEST{ENTER}">>tmp.vbs
echo WScript.Sleep 1000 >>tmp.vbs
echo sh.SendKeys "exit{ENTER}" >>tmp.vbs
echo WScript.Sleep 300 >>tmp.vbs
echo sh.SendKeys "{ENTER}" >>tmp.vbs

start PASAdmin.exe
cscript //nologo tmp.vbs
del tmp.vbs

But when the job runs at scheduled time and is executed,  status of the batch file shows "successfully executed" in Task Scheduler but data is not getting updated in the scorecard.

I am not able to fine out why this file is not able to execute the SPs and not updating the data.

Kindly help and suggest me a solution.

Thanks,

Yash