BookmarkSubscribeRSS Feed
AshwaniGupta
Calcite | Level 5

Hello <

 

I am facing one DB2 libname issue.

 

My libname getting assign perfectly while running on SAS EG or SAS DI Code editor . but when i scehdule our job and ran on SAS batch server (LSF platform process manager) it is giving issue.

 

Below is error Msg.

 

Libname db2_XYZ Datasrc=ABC Schema =XXX Authdomain=XXXXXX;

ERROR: Error allocating CLI Environment.

ERROR: Error in libname statement.

 

.. I am surprise that the same libname connecting on EG or DI. just givinng error while running on LSF.

 

Please help me on this.

8 REPLIES 8
nhvdwalt
Barite | Level 11

Hi @AshwaniGupta 

 

I'm assuming Linux here and that your LSF jobs run under a different user id than the EG/DI jobs.

 

I would start by checking that the environment variables needed to locate the DB2 client is set up the same for the different user ids. It's possible that the variable e.g. LD_LIBRARY_PATH is configured for the EG/DI user but not the LSF batch user.

 

 

AshwaniGupta
Calcite | Level 5

Hi @nhvdwalt 

 

Yes, here is Linux. But the User Id's are same for EG/DI and LSF.

 

Where i can find this environment variable 'LD_LIBRARY_PATH' ?  I will cross check that once.

 

nhvdwalt
Barite | Level 11

 

Have a look in !SASROOT/bin/sasenv_local

 

Look for 'SAS Access to DB2' in the below document:

http://support.sas.com/documentation/installcenter/en/ikfdtnunxcg/66380/PDF/default/config.pdf

 

There is tells you what UNIX variables need to be set.

 

Also check the .bash_profile script for every user to ensure no variables are set there.

Lenvdb
Quartz | Level 8
The engine is missing in your libname statements. What cli engine are you using? We use odbc .
AshwaniGupta
Calcite | Level 5

@Lenvdb  ..

 

Yeah, that's typo error.  We are using DB2 engine .

 

nhvdwalt
Barite | Level 11

Well spotted @Lenvdb  !

AshwaniGupta
Calcite | Level 5

This libname was working fine about a week ago. 

 

I checked  variables files, there is no change recently.

 

We also restart our LSF service as issue is only on LSF batch server. But still facing issue.

 

One strange thing i experience that when i use only libname statement in job (no other code), that time its working fine, but when we tried to run select statement that time only we are facing issue.

 

LIBNAME db2 DB2  Datasrc=XXXX   SCHEMA=TXN  AUTHDOMAIN="XXXXXXXX" ;
ERROR: Error allocating CLI environment.
ERROR: Error in the LIBNAME statement.
95         
96         data test;
97         set db2.Table_name(obs=100);
ERROR: Libref DB2 is not assigned.
SASKiwi
PROC Star

If it was working a week ago then what has changed since then? Worth checking with your DB2 Administrator in case anything has changed on the database side. SAS Tech Support is your best option for progressing this.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 2220 views
  • 1 like
  • 4 in conversation