<?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 Re: %include statement in VIYA in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603241#M8266</link>
    <description>&lt;P&gt;Multiple questions you need to answer.&lt;/P&gt;
&lt;P&gt;Does the file exist? Is it not empty? Does it actually have SAS code? Or something else?&lt;/P&gt;
&lt;P&gt;You could make a slight change to your DATA step so you could look at the first few lines of the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS /';
data _null_;
  infile myfldr ('infile_put.sas') obs=5;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it looks like it is there and is the code you want to run then try replacing the DATA step with the %INCLUDE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS /';
%include myfldr ('infile_put.sas') / source2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Nov 2019 15:21:40 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-11-11T15:21:40Z</dc:date>
    <item>
      <title>%include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603099#M8260</link>
      <description>&lt;P&gt;Hello everyone.&lt;BR /&gt;I am trying to call a .sas program in SAS Viya from a location on the server.&lt;BR /&gt;I have used the filesrvc command but it doesn't work.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;These are the sentences:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS /';
data _null_;
infile myfldr ('infile_put.sas');
run&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the log:&lt;/P&gt;&lt;PRE&gt;NOTE: The infile library MYFLDR is:
Directory = / Users / Edachiardi / CodigosSAS /,
Folder Identifier = af055b98-acdc-44f8-a874-da6bdd394aa4,
Last Modified = November 10, 2019 17H46
NOTE: The infile MYFLDR ('infile_put.sas') is:
Filename = infile_put.sas,
URI path = / files / files / 12f21451-b610-4fb7-b1ed-cbc76791a98b,
File Identifier = 12f21451-b610-4fb7-b1ed-cbc76791a98b,
Content Type = application / octet-stream,
Parent URI = / folders / folders / af055b98-acdc-44f8-a874-da6bdd394aa4,
RECFM = V, LRECL = 32767, File Size (bytes) = 135,
Last Modified = November 10, 2019 18H02,
Create Time = November 10, 2019 4:45 PM
NOTE: A total of 0 records were read from the infile library MYFLDR.
NOTE: 0 records were read from the infile MYFLDR ('infile_put.sas').
NOTE: DATA statement has used (Total process time):
real time 0.52 seconds
cpu time 0.17 seconds&lt;/PRE&gt;&lt;P&gt;Any ideas for correct invocation.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 23:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603099#M8260</guid>
      <dc:creator>elmendamian</dc:creator>
      <dc:date>2019-11-10T23:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603130#M8261</link>
      <description>&lt;P&gt;I see no %include in your code.&lt;/P&gt;
&lt;P&gt;In the data step, there is no input statement, so nothing is read.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 08:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603130#M8261</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-11T08:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603237#M8265</link>
      <description>&lt;P&gt;Hi &lt;SPAN class="UserName lia-user-name lia-user-rank-Super-User"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562" target="_self"&gt;&lt;SPAN class="login-bold"&gt;KurtBremser&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;, thanks for your answer.&lt;/P&gt;&lt;P&gt;The %include statement works in SAS Guide or base, in VIYA doesn't work. &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;The recommendation&lt;/SPAN&gt;&lt;/SPAN&gt; for "accessing a File by Name and Folder" in SAS VIYA is the "fileserv" instruction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to include lot of sas code files into a data step &lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;but I could not.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603237#M8265</guid>
      <dc:creator>elmendamian</dc:creator>
      <dc:date>2019-11-11T15:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603241#M8266</link>
      <description>&lt;P&gt;Multiple questions you need to answer.&lt;/P&gt;
&lt;P&gt;Does the file exist? Is it not empty? Does it actually have SAS code? Or something else?&lt;/P&gt;
&lt;P&gt;You could make a slight change to your DATA step so you could look at the first few lines of the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS /';
data _null_;
  infile myfldr ('infile_put.sas') obs=5;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it looks like it is there and is the code you want to run then try replacing the DATA step with the %INCLUDE statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS /';
%include myfldr ('infile_put.sas') / source2;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603241#M8266</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-11T15:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603246#M8267</link>
      <description>&lt;P&gt;From where do you take it that %include does not work in Viya? There is nothing in the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p1s3uhhqtscz2sn1otiatbovfn1t.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt; that suggests it won't work in the CAS server.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:33:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603246#M8267</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-11T15:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603248#M8268</link>
      <description>&lt;P&gt;Hello again, looks this log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1     OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
77    
78    data file;
79    %include "/Users/Edachiardi/CodigosSAS/infile_put2.sas";
WARNING: Physical file does not exist, /Users/Edachiardi/CodigosSAS/infile_put2.sas.
ERROR: Cannot open %INCLUDE file /Users/Edachiardi/CodigosSAS/infile_put2.sas.
80    run;
NOTE: The data set WORK.FILE has 1 observations and 0 variables.
NOTE: DATA statement ha utilizado (Tiempo de proceso total):
      real time           0.00 seconds
      cpu time            0.00 seconds
      
81    
82    
83    OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
97    &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VIYA was installed in a server Linux&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603248#M8268</guid>
      <dc:creator>elmendamian</dc:creator>
      <dc:date>2019-11-11T15:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: %include statement in VIYA</title>
      <link>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603254#M8269</link>
      <description>&lt;P&gt;Hi Tom, thank you very much.&lt;/P&gt;&lt;P&gt;The second sentence that you send me works very good.&lt;/P&gt;&lt;P&gt;This is the log.&lt;/P&gt;&lt;PRE&gt;1     OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
77    
78    filename myfldr filesrvc folderPath = '/Users/Edachiardi/CodigosSAS/';
79    data file;
80    %include myfldr ('infile_put2.sas') / source2;
NOTE: %INCLUDE (level 1) file MYFLDR(infile_put2.sas) is file infile_put2.sas.
81   +   input x y month $;
82   +   datalines;
NOTE: The data set WORK.FILE has 4 observations and 3 variables.
NOTE: DATA statement ha utilizado (Tiempo de proceso total):
      real time           1.01 seconds
      cpu time            0.25 seconds
      
87   +;
NOTE: %INCLUDE (level 1) ending.
88    run;
89    
90    OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
104   &lt;/PRE&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 15:49:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/include-statement-in-VIYA/m-p/603254#M8269</guid>
      <dc:creator>elmendamian</dc:creator>
      <dc:date>2019-11-11T15:49:56Z</dc:date>
    </item>
  </channel>
</rss>

