<?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: Error running code on server, but works fine on local in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562106#M157429</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir = C:\Users\....;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is your server running Windows?&amp;nbsp; Does it have the same files in the same place as your local machine does?&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 20:46:52 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-05-28T20:46:52Z</dc:date>
    <item>
      <title>Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562105#M157428</link>
      <description>&lt;P&gt;I everyone, im triying to make this code work on server, but it shows me the next error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Argument 1 to function DNUM referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.&lt;BR /&gt;NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set&lt;BR /&gt;to a missing value.&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;BR /&gt;&amp;amp;dnum&lt;BR /&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;BR /&gt;ERROR: The macro READ_FILES will stop executing.&lt;BR /&gt;89&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nevertheless, if i run the same code but with local, i dont get any error, everything works fine. Any clues? Many thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW This is the code i'm using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dir = C:\Users\....;&lt;BR /&gt;libname INSUMOS&amp;nbsp;"/SASDATA/...../";&lt;BR /&gt;%let libreria=INSUMOS.;&lt;BR /&gt;options compress=yes;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;%macro read_files (dir, LIBRERIA);&lt;BR /&gt;%let rc=%sysfunc(filename(rawdata,&amp;amp;dir));&lt;BR /&gt;%let did=%sysfunc(dopen(&amp;amp;rawdata));&lt;/P&gt;&lt;P&gt;%let dnum=%sysfunc(dnum(&amp;amp;did));&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;dnum;&lt;BR /&gt;%let name_file=%sysfunc(dread(&amp;amp;did,&amp;amp;i));&lt;BR /&gt;&lt;BR /&gt;%let FORMATO=%sysfunc(scan(&amp;amp;name_file,2,.));&lt;/P&gt;&lt;P&gt;%if &amp;amp;FORMATO=xlsx %then %do;&lt;BR /&gt;%let name_file_short=%sysfunc(scan(&amp;amp;name_file,1,.));&lt;/P&gt;&lt;P&gt;data _NULL_; *Extrae el nombre del archivo;&lt;BR /&gt;FECHA=scan("&amp;amp;name_file_short",-1,"_");&lt;BR /&gt;call symput('FECHA', FECHA);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC IMPORT OUT=&amp;amp;LIBRERIA.&amp;amp;name_file_short /&lt;BR /&gt;DATAFILE="&amp;amp;dir\&amp;amp;name_file"&lt;BR /&gt;DBMS=xlsx&lt;BR /&gt;REPLACE;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Data &amp;amp;libreria&amp;amp;name_file_short;&lt;BR /&gt;SET &amp;amp;libreria&amp;amp;name_file_short;&lt;BR /&gt;FECHA_NOMBRE= "&amp;amp;name_file_short";&lt;BR /&gt;FECHA2="&amp;amp;FECHA";&lt;BR /&gt;FECHA=input(FECHA2,DDMMYY8.);&lt;BR /&gt;FORMAT FECHA DATE9.;&lt;BR /&gt;DROP FECHA2;&lt;BR /&gt;if RFC = " " then delete;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;data INSUMOS.tot_comb;&lt;BR /&gt;set &amp;amp;LIBRERIA.EC:;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%read_files(&amp;amp;dir, &amp;amp;libreria);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 20:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562105#M157428</guid>
      <dc:creator>Mxmaverick</dc:creator>
      <dc:date>2019-05-28T20:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562106#M157429</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let dir = C:\Users\....;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is your server running Windows?&amp;nbsp; Does it have the same files in the same place as your local machine does?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 20:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562106#M157429</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-28T20:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562111#M157433</link>
      <description>&lt;P&gt;Not windows on server.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i tried changing everything to just run on server and it works properly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let dir = /SASDATA/Proyectos/siavo3/prompts/Prueba/;&lt;BR /&gt;libname INSUMOS "/SASDATA/Proyectos/siavo3/prompts";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it's not what i want, and at least we know it's not the code&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 21:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562111#M157433</guid>
      <dc:creator>Mxmaverick</dc:creator>
      <dc:date>2019-05-28T21:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562113#M157435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275425"&gt;@Mxmaverick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Not windows on server.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UPDATE:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i tried changing everything to just run on server and it works properly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let dir = /SASDATA/Proyectos/siavo3/prompts/Prueba/;&lt;BR /&gt;libname INSUMOS "/SASDATA/Proyectos/siavo3/prompts";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it's not what i want, and at least we know it's not the code&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Don't leave us hanging like that. Explain what it is that you do want?&lt;/P&gt;
&lt;P&gt;Do you want the server to connect to your machine and find the files?&amp;nbsp; Is your machine running an FTP or SFTP server that it could use?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 21:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562113#M157435</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-28T21:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562114#M157436</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want the server to connect to my machine and find the files. Im using SAS GUIDE, so i just need to put an IP, port, user and password.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 21:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562114#M157436</guid>
      <dc:creator>Mxmaverick</dc:creator>
      <dc:date>2019-05-28T21:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562116#M157438</link>
      <description>The Server can't see your desktop. You need to either set up a shared location that both the server and your computer can access for file transfers or use the Transfer Data Task to upload/download files. Unfortunately that cannot be scripted.</description>
      <pubDate>Tue, 28 May 2019 21:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562116#M157438</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-28T21:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Error running code on server, but works fine on local</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562119#M157440</link>
      <description>Seems legit, thank you very much.</description>
      <pubDate>Tue, 28 May 2019 22:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-running-code-on-server-but-works-fine-on-local/m-p/562119#M157440</guid>
      <dc:creator>Mxmaverick</dc:creator>
      <dc:date>2019-05-28T22:03:03Z</dc:date>
    </item>
  </channel>
</rss>

