cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
mochar
Level III

Is there a way to run a JSL script with an input?

I'm wondering if I can run a jsl remotely and give it a directory right away... 

 

I have a jsl script that uses a directory of a file and executes some commands. I would like to send it the directory of the file in a simple way where gui's wouldn't be involved (hopefully).

this is how i execute a jsl script from my PC at the moment:

os.system('cd "C:/Program Files/SAS/JMP/14/" && jmp.exe "directory_to_script\blah.jsl"')

 

wondering if sending another line of code would send it the directory? Any clue, or any ideas to how to do this in a clean way?

6 REPLIES 6
Craige_Hales
Super User

Re: Is there a way to run a JSL script with an input?

Use an environment variable, and GetEnvironmentVariable("name") in JSL to retrieve it. (You can't use SetEnvironmentVariable(...) to return it, as far as I can tell.) @briancorcoran Environment Variable named RALPHEnvironment Variable named RALPH

JMP gets a copy of the environment when it starts.

 

Craige
Craige_Hales
Super User

Re: Is there a way to run a JSL script with an input?

A little more complete example:

Environment variable AND a scriptEnvironment variable AND a script

You could also end the script with a quit(); command if needed.

Craige
mochar
Level III

Re: Is there a way to run a JSL script with an input?

Whenever I look at my log window, Get environment variable("RALPH" = "";

 

in my cmd window, it tells me that 'RALPH' is not recognized as an internal or external command

 

 

mochar_1-1585856512189.png

 

Craige_Hales
Super User

Re: Is there a way to run a JSL script with an input?

Use the SET command in the CMD window to set environment variablesUse the SET command in the CMD window to set environment variables

Craige
mochar
Level III

Re: Is there a way to run a JSL script with an input?

Thanks! Was able to finally make it work with your help. 
Can this be done with more than one environment variable? Can I have 2 or three environment values at a time?

pmroz
Super User

Re: Is there a way to run a JSL script with an input?

Yes you can have as many environment variables as you need.