<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic setting views with PROC DS2 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/setting-views-with-PROC-DS2/m-p/393218#M277812</link>
    <description>&lt;P&gt;Hi, I am trying to get proc ds2 to work for setting a SAS view from a library (the engine of the view is SQLVIEW) but I can't go past the set statement and I can't understand why. I am running sas 9.3&lt;/P&gt;&lt;P&gt;It's as if SAS cannot find the libname, albeit I am sure i defined it correctly.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname _all_ clear;

data class;
set sashelp.class;
run;

/* this works */
proc ds2;
data _null_;
	method run();
      set class;
   end;
run;
quit;

/* this does not work, but it's ok */
proc ds2;
data _null_;
	method run();
      set sashelp.class;
   end;
run;
quit;

libname mylib base 'path/to/my/lib/with/views/in/it';
/* this runs ok, as the view exists */
proc contents data=mylib.myview; run; 

/* this DOES NOT work, and it's driving me mad */
proc ds2;
data _null_;
	method run();
      set mylib.myview;
   end;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any pointer would be appreciated, thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2017 13:56:15 GMT</pubDate>
    <dc:creator>lambdavu</dc:creator>
    <dc:date>2017-09-05T13:56:15Z</dc:date>
    <item>
      <title>setting views with PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/setting-views-with-PROC-DS2/m-p/393218#M277812</link>
      <description>&lt;P&gt;Hi, I am trying to get proc ds2 to work for setting a SAS view from a library (the engine of the view is SQLVIEW) but I can't go past the set statement and I can't understand why. I am running sas 9.3&lt;/P&gt;&lt;P&gt;It's as if SAS cannot find the libname, albeit I am sure i defined it correctly.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname _all_ clear;

data class;
set sashelp.class;
run;

/* this works */
proc ds2;
data _null_;
	method run();
      set class;
   end;
run;
quit;

/* this does not work, but it's ok */
proc ds2;
data _null_;
	method run();
      set sashelp.class;
   end;
run;
quit;

libname mylib base 'path/to/my/lib/with/views/in/it';
/* this runs ok, as the view exists */
proc contents data=mylib.myview; run; 

/* this DOES NOT work, and it's driving me mad */
proc ds2;
data _null_;
	method run();
      set mylib.myview;
   end;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any pointer would be appreciated, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 13:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/setting-views-with-PROC-DS2/m-p/393218#M277812</guid>
      <dc:creator>lambdavu</dc:creator>
      <dc:date>2017-09-05T13:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: setting views with PROC DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/setting-views-with-PROC-DS2/m-p/393246#M277813</link>
      <description>&lt;P&gt;To use a sas data set view in the DS2 Procedure is must be created by the FEDSQL Procedure statement CREATE VIEW. &amp;nbsp;A view using the SQL Procedure will not be compatible and neither will a view created by the data statement VIEW=&amp;nbsp;argument.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* no access to sashelp from fedsql/ds2;
data class;
set sashelp.class;
run;

proc sql;
create view v_class
         as
	 select *
	   from class ;
quit;

proc fedsql;
    create view v_class2 
             as 
         select * 
           from class ;
quit;

data v_class3 / view=v_class2;
set class;
run;

proc ds2;
    * fails... cannot use PROC SQL view;
    data class2;
        method run();
            set v_class;
		end;
    enddata;
    run;
    * fails... cannot use DATA Statement view;
    data class2(overwrite=yes);
        method run();
            set v_class3;
		end;
    enddata;
    run;
    * success... can use FEDSQL view;
    data class2(overwrite=yes);
        method run();
            set v_class2;
		end;
    enddata;
    run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 14:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/setting-views-with-PROC-DS2/m-p/393246#M277813</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-09-05T14:49:44Z</dc:date>
    </item>
  </channel>
</rss>

