BookmarkSubscribeRSS Feed
LineMoon
Lapis Lazuli | Level 10

Hello,

I would like to run sas on unix by VBA, .bat file

is it possible to use a VBA program to create a .bat file to run a sas session on unix ? How

Thank you for your answer.

 

 

 

6 REPLIES 6
LinusH
Tourmaline | Level 20

Can you elaborate about your requirement?

Why do you want to use VBA?

What kind of batches do you have, and how do you wish to deploy them?

Do you have a metadata server?

 

Technically, to answer your direct question, is not a SAS question. So it would be better replied in a VBA or UNIX forum.

Data never sleeps
DavidPope
SAS Employee

This is technically possible, but it really isn't a case of whether SAS supports this or not.   Yes, SAS can be run in batch on Unix by writting a unix script that executes the proper command line commands.  As a result if you write a VBA program that executes on windows via a .bat file if your windows machine has the proper connectivity to the unix server than you can do what you want.  

 

As asked by a previous responder what is your overall goal, because simply because its technically possible doesn't always mean it is a feasible way to run a product level application/job.

LineMoon
Lapis Lazuli | Level 10

Thank you for your answer.

That's very kind from you. I have used unix to run sas session before.

To explain, I have a VBA on server a and SAS uner unix and cmd on server b. There is no connexion between the server a and server b. But there is a commun folder R:\ on server a and server b.

The idea is to run VBA on server a to create a batch.bat file in folder R:\ and run batch.bat on server b to run a sas session on server b.

Thank you.

 

DavidPope
SAS Employee

The issue you are running into is that you are trying to execute a unix cmd (script) using a Windows OS user (via VBA and .bat).

Your .bat file will need to rlogin to the unix environment (which will require a unix userid/password) and then pass the necessary unix cmds to be executed by that unix id.  Think about the servers like you would the userids/commands they can run as different "scopes".

If you are familiar with scope when it comes to running procedures or macros it is somewhat similar to that.

 

LineMoon
Lapis Lazuli | Level 10

Thank you that's very kind from you.

Non, I am not familiar with scope, but any documentation for that's are welcomed.

There is no connexion allowed between the servers a and b, but there is one commun directory R:\ in a and b

Thank you again.

DavidPope
SAS Employee

"Scope" in this case is a general programming term.  Look up programming scope for more information.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1675 views
  • 4 likes
  • 3 in conversation