<?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: CALL SET routine not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965094#M375785</link>
    <description>You guys are right, blame me for not checking the existence of the dataset.</description>
    <pubDate>Fri, 25 Apr 2025 01:46:43 GMT</pubDate>
    <dc:creator>whymath</dc:creator>
    <dc:date>2025-04-25T01:46:43Z</dc:date>
    <item>
      <title>CALL SET routine not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965010#M375765</link>
      <description>&lt;P&gt;Run the two code samples from &lt;A href="https://go.documentation.sas.com/doc/de/pgmsascdc/9.4_3.4/proc/p0wy1vqwvz43uhn1g77eb5xlvzqh.htm" target="_blank" rel="noopener"&gt;SAS Help Center&amp;nbsp;&lt;/A&gt;, both of them failed.&lt;/P&gt;
&lt;P&gt;The first one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro setvar;
   %let dsid=%sysfunc(open(sasuser.houses, i));
      /* No leading ampersand with %SYSCALL */ 
   %syscall set(dsid); 
   %let rc=%sysfunc(fetchobs(&amp;amp;dsid, 10));
   %let rc=%sysfunc(close(&amp;amp;dsid));
%mend setvar;
%global price style;
%setvar
%put _global_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log shows:&lt;/P&gt;
&lt;PRE&gt;WARNING: Argument 1 to function SET referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.

GLOBAL PRICE
GLOBAL STYLE
&lt;/PRE&gt;
&lt;P&gt;The second one:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
      /* create variables for assignment */
      /*by CALL SET */
   length style $8 sqfeet bedrooms baths 8 
      street $16 price 8;
   drop rc dsid;
   dsid=open("sasuser.houses", "i");
   call set (dsid);
   do i=1 to 10;
      rc=fetchobs(dsid, i);
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log shows:&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable style is uninitialized.
NOTE: Variable sqfeet is uninitialized.
NOTE: Variable bedrooms is uninitialized.
NOTE: Variable baths is uninitialized.
NOTE: Variable street is uninitialized.
NOTE: Variable price is uninitialized.
NOTE: Argument 1 to function SET(0) at line 18 column 9 is invalid.
style=  sqfeet=. bedrooms=. baths=. street=  price=. dsid=0 i=11 rc=70021 _ERROR_=1 _N_=1
NOTE: The data set WORK.MYDATA has 10 observations and 7 variables.
&lt;/PRE&gt;
&lt;P&gt;And dataset WORK.MYDATA are all missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use 9.4M7 and 9.4M8, see the same result.&lt;/P&gt;
&lt;P&gt;What happend to CALL SET routine?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 06:48:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965010#M375765</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2025-04-24T06:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SET routine not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965024#M375769</link>
      <description>&lt;P&gt;This part is the key one:&lt;/P&gt;
&lt;PRE&gt;NOTE: Argument 1 to function SET(0) at line 18 column 9 is invalid.&lt;/PRE&gt;
&lt;P&gt;You don't show the line numbers with the data step but I will place a wager of a small stack of $$$ bils that line 18 is:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;   call set (dsid);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;DSID has the numeric value of 0. Whis is what the OPEN function returns with the data set is not found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Almost all the better code involving the OPEN and related functions includes bits about checking the results for values &amp;gt;0 and branch of execute when true or a note and recovery code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that my SAS install does not have a SASHELP.HOUSES data set. Either use one that actually exists or make one in your work library. Not all of the online examples run as entered in the help. Some use data sets only available with specific installed modules. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 10:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965024#M375769</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-04-24T10:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SET routine not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965034#M375772</link>
      <description>&lt;P&gt;You do not appear to have a dataset named SASUSER.HOUSES.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally I never put datasets into the SASUSER library since it is normally readonly because I usually run with the -RSASUSER initialization option so SAS will use my SASUSER.PROFILE for settings instead of making and using WORK.PROFILE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using SASHELP.CLASS and the variables it contains, NAME SEX AGE HEIGHT WEIGHT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 13:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965034#M375772</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-04-24T13:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SET routine not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965094#M375785</link>
      <description>You guys are right, blame me for not checking the existence of the dataset.</description>
      <pubDate>Fri, 25 Apr 2025 01:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SET-routine-not-working/m-p/965094#M375785</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2025-04-25T01:46:43Z</dc:date>
    </item>
  </channel>
</rss>

