Knowledge Base

Welcome to The Carlisle Group's Knowledge Base.

Search or Ask a Question

This is a keyword search that looks for matching articles that contain one or more words specifically by a user in articles’ tags, title and content. Admin writes brief intro content here via admin end. If you are unable to find an answer to your issue, please submit an issue here.

Back to Articles List

CAS and command line automation. | CAS

Added: 06/20/2012; Last Modified: 01/20/2015; Visits:2,896

CAS can be started from a command line and a script can be automatically ran.

Sample command path to start CAS: (Adjust file paths for the environment.)

"C:\Program Files (x86)\CarlisleGroup\CAS 5.0\dyalogrt.exe" "C:\Program Files (x86)\CarlisleGroup\CAS 5.0\CAS.dws" inifile="HKEY_LOCAL_MACHINE\Software\CarlisleGroup\CAS 5.0"
 
You must add the following 2 parameters to open a file and run a script.
 
open=”path to the file”
script=”unique name of script to start”
 
For example:
 
"C:\Program Files (x86)\CarlisleGroup\CAS 5.0\dyalogrt.exe" "C:\Program Files (x86)\CarlisleGroup\CAS 5.0\CAS.dws" inifile="HKEY_LOCAL_MACHINE\Software\CarlisleGroup\CAS 5.0" open="C:\Program Files (x86)\CarlisleGroup\CAS 5.0\Files\Samples\sample 50.cas" script="Portfolio Summary"
 
 
Custom Parameters:
 
CAS scripts can read command line parameters.  You simply need to add your parameter=value pairs to the command line.  Once CAS is running, you can use the CasSession.GetCommandLineParameter2 method to return a CharString object.
 
For example:
 
  • Command Line:
"C:\Program Files (x86)\CarlisleGroup\CAS 5.0\dyalogrt.exe" "C:\Program Files (x86)\CarlisleGroup\CAS 5.0\CAS.dws" inifile="HKEY_LOCAL_MACHINE\Software\CarlisleGroup\CAS 5.0" open="C:\Program Files (x86)\CarlisleGroup\CAS 5.0\Files\Samples\sample 50.cas" script="Portfolio Summary" MYPARAM1="VALUE1" MYPARAM2="VALUE2"
  • Script:
P1 ← CasSession.GetCommandLineParameter2 'MYPARAM1'
P2 ← CasSession.GetCommandLineParameter2 'MYPARAM2'
P2.Show 'My Parameter Value'
 
 
 
Note 1
 
CAS cannot pass results back to the command.  Text files can be used for logging and status flags.  Also, if a file is opened by another user, CAS will show a message box asking if you want to open in read-only mode.  To avoid this, set automation script files to "Read-Only" in the Windows file properties.  This is a good idea since it is bad form to overwrite a master script file.  How to set a file to read-only.

 

Note 2

When defining parameters, make sure there are no blank between the parameter the equal sign and the beginning of the value.

Good : file="c:\test\test.cas"

Bad: file ="C:\test\test.cas"