<?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: Assigning Multiple Variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/679570#M205209</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;Thank you for your explanation! You also mentioned in the post that we can fill with not only single values. Let's say I want to create winsorized variables based on a set of variables at their 1st and 99 percentile. I've read each variable's 1st and 99 percentile with output. If I want to use the sasfile statement to fill values in the output file, should I first transpose it to the long format to retain values? I was using %macro and call execute for winsorizing, but I also want to try with the sasfile statement. What's your suggestion?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc means data=mydata p1 p99;&lt;BR /&gt;var ch_score1-ch_score100;&lt;/P&gt;&lt;P&gt;output out =sum p1=lower1-lower100 p99=upper1-upper100;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2020 18:18:16 GMT</pubDate>
    <dc:creator>sdaniels429</dc:creator>
    <dc:date>2020-08-26T18:18:16Z</dc:date>
    <item>
      <title>Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582197#M165554</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to conditionally assign multiple variables to the same value. Is there a better way to do this than using if/ then do logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;data scores;
   infile datalines dsd;
   input Name : $9. Score1-Score3 Team ~ $25. Div $;
   datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA 
Mitchel,23,19,25,"High Volts, Portland",AAA 
Jones,09,17,54,"Vulcans, Las Vegas",AA 
; 

data test;
set scores;
	if name = "Smith" then do;
		Score1=10;
		Score2=10;
		Score3=10;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried something like this, but this returns 0, which I think means "no, the two statements are not equal" (because Score2 is not the same as Score3).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set scores;
	if name = "Smith" then do;
		Score1=10=Score2=Score3;
*or Score1=Score2=Score3=10;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas, or is my way the way to go?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 17:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582197#M165554</guid>
      <dc:creator>theponcer</dc:creator>
      <dc:date>2019-08-19T17:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582198#M165555</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
 set scores;
 array score(3);
 if name = "Smith" then 
 do _i_=1 to dim( score);
 score(_i_)=10;
 end;	
 drop _i_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;hmm since score vars are in the input dataset, try an implicit array&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
 set scores;
 array s score:;
 if name = "Smith" then 
 do over s;
 s=10;
 end;	
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582198#M165555</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-19T18:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582199#M165556</link>
      <description>&lt;P&gt;Your first method is the way to do it.&lt;/P&gt;
&lt;P&gt;You are right. The second syntax is being interpreted as a boolean expression to be evaluated and assigned to the variable listed as the target.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582199#M165556</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-19T18:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582201#M165558</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=i);
	set scores;
	array Score{*} Score:;
	if name = "Smith" then do i=1 to dim(Score);
		Score[i]=10;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Aug 2019 18:08:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582201#M165558</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-08-19T18:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582202#M165559</link>
      <description>data test;&lt;BR /&gt;	set scores;&lt;BR /&gt;&lt;BR /&gt;	if name = "Smith" then&lt;BR /&gt;		do;&lt;BR /&gt;&lt;BR /&gt;%macro foo;&lt;BR /&gt;	%do i=1 %to 3;&lt;BR /&gt;		Score&amp;amp;i=10;&lt;BR /&gt;	%end;&lt;BR /&gt;%mend foo;&lt;BR /&gt;&lt;BR /&gt;%foo;&lt;BR /&gt;end;&lt;BR /&gt;run;</description>
      <pubDate>Mon, 19 Aug 2019 18:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582202#M165559</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-08-19T18:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582231#M165574</link>
      <description>&lt;P&gt;Are you assigning a different set of values for each Name or only name='Smith'?&lt;/P&gt;
&lt;P&gt;If you have different values for different names then you likely want something completely different for shorter code but a complete description of the needs will help.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Aug 2019 19:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582231#M165574</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-08-19T19:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582303#M165602</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252152"&gt;@theponcer&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;Actually, you own method is not bad at all; it has only a couple of drawbacks:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. The verbosity of as many assignment statements as many Score variables you have. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;have shown, it is easily addressed using an array and a DO loop. Alternatively, you can generate the code for multiple assignments using a macro, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro vset (vname, N, value) ;
  %do i = 1 %to &amp;amp;N ;
    &amp;amp;vname&amp;amp;i = &amp;amp;value ;
  %end ;
%mend ;

data want ;
  set have ;
  if name = "Smith" then %vset (score, 3, 10) ;
run ;   &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Plus, there exist other methods of assembling executable SAS code (such as CALL EXECUTE, for exampe).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Each Score variable has to be assigned 10 one at a time every time name="Smith", which can present a performance problem if you have many variables (say, 3000 instead of just 3) and many records where name="Smith" (100 million, say). Thus, the question would be: How to assign a given value to all the variables in question &lt;EM&gt;en masse&lt;/EM&gt;, i.e. at once, rather than one at a time? Well, that can be done in more than one way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(A) Methinks the simplest is to prepare a "fill" 1-record SAS data set beforehand and just read that record when needed:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;                                  
  input name :$5. score1-score5 ;            
  cards ;                                    
Baker  1   2   3  23   5                     
Smith  4  50   6   1  13                     
Clark  7   8   9  19   7                     
Smith  1  13  17   3  29                     
Mason  8   7  12  17  11                     
run ;                                        
&lt;BR /&gt;%let n =  5 ;&lt;BR /&gt;%let v = 10 ;    &lt;BR /&gt;                                           
data fill ;                                  
  array score [&amp;amp;n] (&amp;amp;n*&amp;amp;v) ;                 
run ;     &lt;BR /&gt;                                   
sasfile fill load ;    &lt;BR /&gt;                                         
data want ;                                  
  set have ;                                 
  retain p 1 ;                               
  if name = "Smith" then set fill point = p ;
run ;   &lt;BR /&gt;   &lt;BR /&gt;sasfile fill close ;                                  
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that you can fill the Score array items in FILL with any values you want, not just the same single value. If so, the entire logic of doing so would be confined to the first DATA step. The SASFILE statement keeps FILL in memory for the sake of speed of execution. Of course, this method is good for as many "fill" variables as can be had in the DATA step - in other words, there's no &lt;EM&gt;practical&lt;/EM&gt; limit.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(B) A different method uses the APP functions and works by sticking a preset string of real binary images of the needed "fill" numeric values directly into memory. The necessary prep to compose the string and static memory addresses is prepared at _N_=1, so that it wouldn't have to be done in every record:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want (drop = _:) ;                                   
  set have ;                                              
  if _n_ = 1 then do ;                                    
    retain _a _f ;                                        
    _a = addrlong (score1) ;                              
    _f = put (repeat (put (&amp;amp;v,rb8.),&amp;amp;n-1),$%eval(8*&amp;amp;n).) ;
  end ;                                                   
  if name = "Smith" then call pokelong (_f, _a) ;         
run ;                                                     
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This en masse method is very fast, but it has a limitation: Since the string _F cannot exceed $32767, it's limited to int(32767/8)=4095 variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(C) Yet another approach is in principle similar to the POINT= method, only instead of getting the fill values from the single data set record, it gets them from a single hash table item:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;                                           
  if _n_ = 1 then do ;                                
    dcl hash h (dataset: "have(keep=score: obs=0)") ;
    h.definekey ("score1") ;                          
    h.definedata (all:"Y") ;                          
    h.definedone () ;                                 
    if 0 then set have (keep=score:) ;                
    array score [&amp;amp;n] (&amp;amp;n * &amp;amp;v) ;                      
    h.add() ;                                         
  end ;                                               
  set have ;                                          
  if name = "Smith" then h.find (key: &amp;amp;v) ;           
run ;                                                 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I expect this method to be on par with POINT= or a tad faster; and it has no limit on the number of Score variables, either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 03:29:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582303#M165602</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T03:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582308#M165604</link>
      <description>&lt;P&gt;There's &lt;A href="https://communities.sas.com/t5/SASware-Ballot-Ideas/New-function-similar-to-call-missing-to-assign-any-value-to/idc-p/582307#M3840" target="_self"&gt;a ballot entry&lt;/A&gt; for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd be curious to know how many ballot entries have been implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 05:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582308#M165604</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-20T05:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582309#M165605</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;I have no clue how many, either absolutely or percentage-wise. As to this one, I ain't holding my breath for two reasons: (a) don't think it's high on the list of their priorities and (b) they might deem that there's enough existing functionality that can be used to do it if need be. And, truth be told, they may be right about the latter. Furthermore, if one would want to set v[*] to a number of predetermined different values en masse (not just one) - for example, listed in a SAS data set, - it's easy to do with either point= or a hash, as already shown in this thread.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 05:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582309#M165605</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T05:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582313#M165607</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. My guess is: epsilon, asymptotically&amp;nbsp;&lt;SPAN&gt;close to zero.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;2. As for the suggestion itself, a new feature is always unneeded as it can be worked around. The latest most popular language additions are arguably the cat functions, which can easily be replicated using || and trim() and more.&lt;/P&gt;
&lt;P&gt;Yet they contribute to clearer, better code. "Not required" can probably be said of all ballot entries.&lt;/P&gt;
&lt;P&gt;My guess is that the new functions were added because SAS Institute developers thought they'd be useful for their jobs developing new products. Who knows?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 06:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582313#M165607</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-20T06:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582316#M165609</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252152"&gt;@theponcer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And now that you've seen all the different options you might also understand that plain and simple code without any "smarts" is sometimes not a bad option because it's easy to understand and maintain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code sample doesn't show the "if/then" logic you mention but just in case you're looking for an approach which allows you to recode data based on values of another variable below some code using an informat for this instead of separate if/then code blocks.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data scores;
  infile datalines dsd;
  input Name : $9. Score1-Score3 Team ~ $25. Div $;
  datalines;
Smith,12,22,46,"Green Hornets, Atlanta",AAA 
Mitchel,23,19,25,"High Volts, Portland",AAA 
Jones,09,17,54,"Vulcans, Las Vegas",AA 
;

proc format;
  invalue recode
    'Smith'   = 10
    'Mitchel' = 20
    other     = .
  ;
run;

data test;
  set scores;
  if input(name,recode.) ne . then
    do;
      Score1=input(name,recode.);
      Score2=input(name,recode.);
      Score3=input(name,recode.);
    end;
run;

proc print data=test;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 436px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31854i214E4022FFA7953F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 08:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582316#M165609</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-08-20T08:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582322#M165612</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"2. As for the suggestion itself, a new feature is always unneeded as it can be worked around. The latest most popular language additions are arguably the cat functions, which can easily be replicated using || and trim() and more.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Yet they contribute to clearer, better code."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Precisely. Plus the kitties add so much functionality to very frequent necessities that emulating it with workarounds would make code unpalatable. They're a typical example of astutely satisfying a rather urgent demand brought about by common usage by offering a number of canned solutions. The same can be said of the SQL INTO clause and many other things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course I'd more than welcome a fast canned function or call routine that would stick a given value, rather than only a standard missing value, into v[*]. However, compared to the kitties and such, I don't see how much value (aside from the speed) it would add versus how badly it's needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 07:07:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582322#M165612</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T07:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582408#M165659</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21262"&gt;@hashman&lt;/a&gt;&amp;nbsp; Guru, I should get paid on Friday(Biweekly check at Citizens lol). Let me know should i pay for this enormous knowledge share though priceless. WOW!!!!!!!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS&amp;nbsp; Understood everything, SASFILE is something new. henceforth, new addition to my continued learning. Cheers!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 12:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582408#M165659</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-08-20T12:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582426#M165661</link>
      <description>&lt;P&gt;Thanks! This works perfectly and gives me a lot to think about - I really appreciate your thorough answers (and your new book!)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 13:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582426#M165661</guid>
      <dc:creator>theponcer</dc:creator>
      <dc:date>2019-08-20T13:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582435#M165669</link>
      <description>&lt;P&gt;Your first solution that is mixing macro and data step coding is missing a required DO/END block.&amp;nbsp; Currently the program will generate code like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if name = "Smith" then score1=10;
score2=10;
score3=10;
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Fix:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if name = "Smith" then do; %vset (score, 3, 10)  end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 14:09:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582435#M165669</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-20T14:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582542#M165697</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;My pleasure. I knew you would understand everything ... in fact, methought you'd chime in with the APP approach yourself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SASFILE helps particularly well when POINT= reads out of order - for typical example, if a sorted file is looked up using the binary or interpolation search. Of course, there should be enough memory to house the whole thing. But in this case, when we have only 1 record in all, it would never present a problem even with a few thousand variables in question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 18:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582542#M165697</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T18:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582549#M165701</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252152"&gt;@theponcer&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are very welcome.&lt;/P&gt;
&lt;P&gt;And if by the "new book" you mean &lt;EM&gt;our&lt;/EM&gt; hash book published in July 2018,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13569"&gt;@DonH&lt;/a&gt;&amp;nbsp;deserves as much credit, if not more, than yours truly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 19:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582549#M165701</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T19:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582554#M165702</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'Tis true. A truly good attentive eye! Thanks for the fix.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OTOH, the macro can be kept as is but just called from the DATA step differently:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  if name ne "Smith" then return ;
  %vset (score, 3, 10)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 19:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/582554#M165702</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-08-20T19:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/638231#M189792</link>
      <description>&lt;P&gt;Hi, Hashman.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very interested at your method that using the&amp;nbsp;&lt;SPAN&gt;memory addresses. It is so amazing to me. Could you please give me more examples about this? Many thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 05:29:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/638231#M189792</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2020-04-08T05:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/638235#M189793</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270406"&gt;@whymath&lt;/a&gt;:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At the risk of self-aggrandizing, I'd suggest that you read one of my APP papers, for instance (not sure it's the latest):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings14/1510-2014.pdf" target="_self"&gt;https://support.sas.com/resources/papers/proceedings14/1510-2014.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There're many examples in the paper - and, perhaps more importantly, a decent amount of theory. A good theory, as physicists say, is the most practical thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 05:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/m-p/638235#M189793</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2020-04-08T05:56:46Z</dc:date>
    </item>
  </channel>
</rss>

