LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 23 May 2001 07:50:43 -0700
Reply-To:   "Terjeson, Mark" <TerjeMW@DSHS.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Terjeson, Mark" <TerjeMW@DSHS.WA.GOV>
Subject:   Re: SQL ODBC online fine but batch doesn't functions
Comments:   To: Ricke Godehard <Godehard.Ricke@ITELLIUM.COM>
Content-Type:   text/plain; charset=iso-8859-1

Hi Godo,

To give you hope, I can say that I use the same code for interactive and batch for ODBC connectivity and it works fine.

One of the first questions would be: Is the macro variable: &SLA_KS2000_ODBC_DSN been assigned in the batch session? i.e. has there been a previous %LET assignment or some other code that pre-loads it?

Also, if the macro variable is set in your Autoexec.sas or Config.sas, the batch session does not necessarily use the same configuration files, unless you have made sure the paths and everything is set to match your interactive session environment. One way to insure that your batch session is "exactly" the same as your interactive session is to literally specify that your batch session "gets" the same files. You can write the command line to point to the same files that the interactive session uses. (of course you will have to establish the directory paths for your own machine).

D:\sas\sas\sas.exe -autoexec d:\sas\autoexec.sas -config d:\sas\config.sas -nologo -log d:\mywork\mylogfile.log -sysin D:\mydir\sas_programs\myprogram.sas

Another thing you can do is to put a debugging statement in your code, such as:

%put SLA_KS2000_ODBC_DSN is >&SLA_KS2000_ODBC_DSN<; PROC SQL; CONNECT TO ODBC AS &ConnectAlias. (DSN="&SLA_KS2000_ODBC_DSN."); . and then go look at the log file you have specified to be written out and see if the macro variable indeed contains what it is supposed to contain.

Obviously, you can disregard any of these things if you have already done these.......

Hope this is helpful, Mark Terjeson Washington State Department of Social and Health Services Division of Research and Data Analysis (RDA) mailto:terjemw@dshs.wa.gov

-----Original Message----- From: Ricke Godehard [mailto:Godehard.Ricke@ITELLIUM.COM] Sent: Wednesday, May 23, 2001 5:47 AM To: SAS-L@LISTSERV.UGA.EDU Subject: SQL ODBC online fine but batch doesn't functions

Hello,

this source:

PROC SQL; CONNECT TO ODBC AS &ConnectAlias. (DSN="&SLA_KS2000_ODBC_DSN."); . . .

works online. But if I submitted it in batch job it doesn't work and I got the message:

ERROR: CLI error trying to establish connection: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I testet the macro variables - they are correct. Must I set options and which?

Regards Godo


Back to: Top of message | Previous page | Main SAS-L page