BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Jose7
Obsidian | Level 7

Hi experts!

I'm executing a sas program from linux command line, example:

/sas94/sashome/SASFoundation/9.4/sasexe/sas program.sas

I have to assign a libname to connect a sql server database to obtain the data, but I have this problem 

 

ERROR: Could not load /sas94/sashome/SASFoundation/9.4/sasexe/sasodb (32 images loaded)
ERROR: /sas94/sapiq160/IQ-16_0/lib64/libodbc.so: version `VERS_3.52' not found (required by
/sas94/sashome/SASFoundation/9.4/sasexe/sasodb)
1 LIBNAME SAMPLE2 ODBC NOPROMPT="Driver=/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.6.so.1.1;SERVER=999.99.9.999,8888;
1 ! DATABASE=example1;UID=usr_XX;
2 PWD=ABCD" SCHEMA=dbo;
ERROR: The SAS/ACCESS Interface to ODBC cannot be loaded. The SASODB code appendage could not be loaded.
ERROR: Error in the LIBNAME statement.

 

I also have tried this: LIBNAME SAMPLE2 ODBC DATAsrc=NAMESRC_S SCHEMA=dbo USER=usr_XX PASSWORD="{SAS222}828A4PP5CB131A25BC" ;

and I obtain the same error.

BUT, when I do it from SAS enterprice Guide, both libname staments work fine!

any idea?

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

As @Quentin proposes: Use sasbatch.sh for your SAS batch jobs. This .sh gets built as part of a SAS installation and calls the .cfg and autoexec files that have been configure for your environment.

View solution in original post

4 REPLIES 4
Quentin
Super User

I've never had luck with using the NOPROMPT method from linux, but the second libname statement looks good to me:

LIBNAME SAMPLE2 ODBC DATAsrc=NAMESRC_S SCHEMA=dbo USER=usr_XX PASSWORD="{SAS222}828A4PP5CB131A25BC" ;

You get:

ERROR: The SAS/ACCESS Interface to ODBC cannot be loaded. The SASODB code appendage could not be loaded.

from that as well?  When you run the batch job, are your running it on the same linux SAS server which EG is connected to?  

 

 

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Jose7
Obsidian | Level 7
Yes, I Obtain both errors (ODBC y SASODB), and it´s the same linux SAS server which EG is connected to


Quentin
Super User

I guess it's possible that EG is using a different config file when it launches SAS.  The config file points to the ODBC connection info etc.  You might be able to work with your SAS admin to figure out what config file (and possibly other option) EG is using.

 

The other possible path would be to use another metadata-aware SAS client to batch submit the program.  My understanding is SAS Management Console can batch submit a program.  I've also used DI studio to define a simple job with a single %include statement.  Then if I deploy that job for scheduling, DI studio writes a .sas file that can be batch submitted from a shell script.

 

On my linux server, the shell script (I think provided by sas is called sasbatch.sh).  So if I run:

 

/opt/sas/sasconfig/.../BatchServer/sasbatch.sh 
  -sysin /quentin/myprogram.sas
  -batch
  -noterminal

it will batch submit myprogram.sas.  And I think the shell script loads the config files that are used by EG (or I guess by the batch server), and it does the metadata login etc.  So all the stuff that EG automatically enables works.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Patrick
Opal | Level 21

As @Quentin proposes: Use sasbatch.sh for your SAS batch jobs. This .sh gets built as part of a SAS installation and calls the .cfg and autoexec files that have been configure for your environment.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 514 views
  • 2 likes
  • 3 in conversation