Architecting, installing and maintaining your SAS environment

How to use different client configuration for SAS on Citrix Server

Reply
Occasional Contributor
Posts: 8

How to use different client configuration for SAS on Citrix Server

Hi,

A group of our users use Autoexec.sas for each of their projects for SAS installed locally.  When they start, the autoexec.sas sets up an environment for further processing at their choice.

Their local SAS licenses will be expires soon and they want to run their projects using SAS on the Citrix server(Windows 2008 R2), which would be a lot cheaper for them.

At first we tried to allow users to pass their SAS program as parameter to run on the server, but SAS runs the program in batch mode and closes when it'd done, and users want SAS remains open for their further choice of tasks. I also tried to put a user's autoexec.sas in a local folder which is set as Citrix SAS shortcut's Start folder with hope that it ran it automatically, but it didn't.

We haven't tried set SAS to run in stream on users' computers, which we don't have policy to do, nor do we want to publish multiple SAS applications with different configuration. I guess we have to figure out a way to do that on client side. 

So my question is

1)Is it possible to keep SAS open after the program runs, using something like ->CItrix-SAS.exe myprogram.sas?

2)So far we found only this way to pass a parameter(CItrix-SAS.exe myprogram.sas) that SAS on the server picks it up. If we pass more than that, SAS on the server would start and remain open disregarding those parameters. So could anyone give some ideas of how to solve the problem?

Thank you in advance.

Regards,

lee

Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

I know that I could put those lines in autoexec.sas into the main program of the a project or use %input in the main program. I guess I may have to tell our users to do that if we cannot figure out another way the got so used to.

Thanks for any ideas.

lee

Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

I meant %include not %input.

Trusted Advisor
Posts: 3,213

Re: How to use different client configuration for SAS on Citrix Server

This Question has nothing to do using Citrix.

You want to solve the use of  Base SAS/foundation in a way they are promoting it with the EIP using the app-servers.

Some questions:

- As Citrix is a virtualization approach you could run out of real computer-resources for the user-requests.

  SAS can be very demanding for memory and cpu being limited in the IO.

- SAS has many assumptions on the current directory,  SASuser config autoexec. I is not necessary equal to the short-cut.

  The short-cut is mostly opening a new process (detached) totally unaware where it came from.

  Knowing this you could defnine a own script (bat/cmd file) that manages the Windows environment setttings before sas gets control.

I know al lot of people are saying uhhhh difficult I am not understanding that.  At the same time this is exactly what is SAS is doing with their app-server (Levx) files to be configured (usermods). I see this way as an acceptable one.  One important requirement: you need somebody that is understanding Windows and SAS at skilled level.

If you want to maintain autoexec/config-s etc centrally for all users you could think off.

- define add settings to SAS your locations are get known

- define to the bat/cmd script parameters like application DTAP process-type.  And for every combination there can be a menu-shortcut

Wou will end up with those menu-s tailored to the user-application-names.

In that world SAS is just a runtime execution environment like Java. Would SAS being replace by an other runtime execution environment the start menus do not need  any changes it are those scritpts binding an other execution-run time environmet.     

---->-- ja karman --<-----
Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

Hi Jaap,

Thanks a lot for your suggestions. So it's impossible to stop a background process starting with "SAS.EXE myfile.sas" in the middle and leave SAS open in interactive mode under Window's environment. 

Regards,

lee

Super User
Super User
Posts: 7,046

Re: How to use different client configuration for SAS on Citrix Server

You could just let the SAS users connect to a Windows desktop running on Citrix and then launch SAS on that desktop the same as they have been launching it on their individual PC's.  I am not a Citrix expert, but I suspect that the Citrix admins would not prefer this method.

Otherwise the issue becomes one of how they are using SAS now.  Are they running it interactively or not?  If they are running it interactively you could just give them a tool to use inside of SAS to point to the directory they want to use and then you have the information needed to %include the autoexec from that directory (and do any other environment setup that you want).  Not sure if you are prepared to build and support that type of application.

If they are used to running it in background the way you could from the command line of say a Unix system.

Example:  > cd projectdir

                 projectdir>  sas program1

That will be harder to implement using Citrix "icons".  Perhaps Citrix has a way of telling what directory you are using on your local machine before trying to run an application from the Citrix farm, but I have never seen it done.

Trusted Advisor
Posts: 3,213

Re: How to use different client configuration for SAS on Citrix Server

Tom, the descritption I have given, you never seen it done. Was implementded by me.  It was done.
Perhaps I can find the UniX and Windows versions. And there are two of them on each platform.

One encapsulating/wrapping sas.exe as needed to set the Windows environment (those set /path)  for the sas-system.

One having defined <project_id> etc. with an initstmt-option in a sas-config activated.

By that "call project_id" can do personalization in the scripting.

The sas-autoexec sas-config activated at that location becoming active. 

%project_id call can do startups includes etc.

It is supporting working with SAS beyond the "put a floppy in" approach   

---->-- ja karman --<-----
Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

Thanks, Tom.

We may end up in doing by adding one line of code.  We've been trying just because our users want the way they've been used to.

Regards,

lee

Trusted Advisor
Posts: 3,213

Re: How to use different client configuration for SAS on Citrix Server

leeli, As you are working under Windows this is the documentation specific for interacting and starting SAS.

SAS(R) 9.4 Companion for Windows, Third Edition ( Starting SAS) As you see there is a interactive and batch mode to run SAS.

When you give a myfile.sas as option it is assumed to have the -sysin option running in batch! There are a lot more things switching together with that.

That is why you cannot switch afterwards.  See the sysin as a replacement for the program editor, the ".log" as a replacement for the log window, the "-.lst" as a replacement for the output window. These files are actually being created when you run a sas-program this way.

When you go to SAS(R) 9.4 Companion for Windows, Third Edition (SAS system options) you will also find the autoexec option.  That one I have mentioned before. It can be build up with a lot conventions. Basically it is just starting the mentioned sas-source (could be myfile.sas)  as also  the initstmt option (and termstmt), a lot of options.

By the way your business-case of license cost could be a fake one. Normally the SAS windows is licensed on a named users approach.

That doesn't change by virtualization. Real gain could come from a move to Server-bases processing (EIP). That is however much more challenging than a desktop approach.

---->-- ja karman --<-----
Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

Thanks, Jaap.

You've really shed some light on the issue. I'm going to suggest our users to add one line of the code at the beginning of each of their projects to set up the desired environment. Hopefully they would accept it.

Regards,

lee

Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

Our users don't like to put the line in their project. They insist the environment setting before they open their projects. So the only question left for me to ask is whether setting the published app as stream, which can run offline, would allow to use SAS command-line switch -autoexec ssss.sas on the client computer.

Hope get some ideas from someone who has done that.

Thanks in advance.

lee

Trusted Advisor
Posts: 3,213

Re: How to use different client configuration for SAS on Citrix Server

I am not a Citric specialist but assume you can give parameters to be started applications as Windows does.

SAS will accept parameters on the command line switches as you have mentioned.

The real naming and dependicies you have is your part, putting all those loose pieces together to a working accepted way.  

---->-- ja karman --<-----
Occasional Contributor
Posts: 8

Re: How to use different client configuration for SAS on Citrix Server

Thanks for your response.

As I said before, our users want to run SAS in interactive mode.  I tried to pass -autoexec xxx.sas but it doesn't work. If I pass xxx.sas, SAS would run in non-interactive mode.

Hopefully someone who has done something like what we want to  achieve can shed some light.

Regards,

lee

Trusted Advisor
Posts: 3,213

Re: How to use different client configuration for SAS on Citrix Server

leeli,  I understand your issue but the sas.exe program really should process the parameter you have given.

I have done that extensively with plain Windows. Given a filename directly will switch to batch mode.

What this tells you:

- the way you are given parameters from Citrix to SAS is working otherwise it would not switch.

- giving the autoexec parameter is wrong at some point. You have to investigate what you defined wrong. possible causes:

  + Special chars like - interpreted wrong by a step in between  (citrix or a tailored script)

  + Space handling the original long string splitting up in multiple shorter ones.  (citrix or tailored script). The effect of this is parameter recognition will fail.

     Quotes can be important at this as it is the same in the long filenames in Windows.

  + Wrong location or naming of your SAS autoexecfile. SAS(R) 9.4 Companion for Windows, Third Edition

     As the SAS process will not start in the current dir you are specifying with Citrix as probably starting a new session. What is the one?

     You could verifiy some of these using your current situation and use X-commands.

You should really be comfortable working with SAS solving these kind issue at OS level (both sides!).  

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 13 replies
  • 1895 views
  • 3 likes
  • 3 in conversation