From: "Data _null_;" on
I THINK init_string would go in the LIBNAME function's forth parameter, OPTIONS.

options
names one or more options honored by the specified engine, delimited
with blanks.

If you can't get it to work you may be able to use CALL EXECUTE to
execute the LIBNAME statement.

On 1/5/10, Ken Barz <zrab123(a)comcast.net> wrote:
> We have a generalized macro that creates libname assignments based on values passed in a metadata dataset using the libname function. Naturally, now we have a new data management system that breaks that. So, if I have a libname that looks like so:
>
> libname datain oledb init_string="Provider=VFPOLEDB.1;Data Source=&inpath.\_system.DBC";
>
> is there some syntax to get the libname function to set using the init_string stuff? The simplified data step we're using is something like:
>
> data _null_;
> set meta.tsc_current_header;
> if type='libname' and include='Yes' then do;
> if parameter = 'DATAIN' then do;
> libn = libname(parameter, resolve(value) , 'oledb');
> end;
> else do;
> libn = libname(parameter, resolve(value));
> end;
> end;
> run;
>
> where parameter is the libname and value (for all other libname assignments) is the path.
> Thanks,
> Ken
>
From: Ken Barz on
Perfect! Thank you!

----- Original Message -----
From: "Data _null_;" <iebupdte(a)gmail.com>
To: zrab123(a)comcast.net
Cc: SAS-L(a)listserv.uga.edu
Sent: Tuesday, January 5, 2010 11:39:21 AM GMT -07:00 US/Canada Mountain
Subject: Re: Libname Function and Connection Strings

I THINK init_string would go in the LIBNAME function's forth parameter, OPTIONS.

options
names one or more options honored by the specified engine, delimited
with blanks.

If you can't get it to work you may be able to use CALL EXECUTE to
execute the LIBNAME statement.

On 1/5/10, Ken Barz <zrab123(a)comcast.net> wrote:
> We have a generalized macro that creates libname assignments based on values passed in a metadata dataset using the libname function. Naturally, now we have a new data management system that breaks that. So, if I have a libname that looks like so:
>
> libname datain oledb init_string="Provider=VFPOLEDB.1;Data Source=&inpath.\_system.DBC";
>
> is there some syntax to get the libname function to set using the init_string stuff? The simplified data step we're using is something like:
>
> data _null_;
> set meta.tsc_current_header;
> if type='libname' and include='Yes' then do;
> if parameter = 'DATAIN' then do;
> libn = libname(parameter, resolve(value) , 'oledb');
> end;
> else do;
> libn = libname(parameter, resolve(value));
> end;
> end;
> run;
>
> where parameter is the libname and value (for all other libname assignments) is the path.
> Thanks,
> Ken
>