<?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: Passing arrays between sas base and scl in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67904#M14719</link>
    <description>I know i was not enough polite, but the RTFM actitude doesn't solved nothing for me.&lt;BR /&gt;
As you said and i finally discovered by myself the calls ymput generate N variables like state1 state2.&lt;BR /&gt;
And seriusly and it's not a joke, i think you'll be a good boss. I have good one, but my solutions will be good until the next release, it's the kind of flexibility that workers hate.&lt;BR /&gt;
I will need the proc sql with :into in the future so thanks. I'm not sarcastic, believe me.</description>
    <pubDate>Wed, 17 Mar 2010 13:09:54 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-03-17T13:09:54Z</dc:date>
    <item>
      <title>Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67898#M14713</link>
      <description>Good morning,&lt;BR /&gt;
&lt;BR /&gt;
I recieve a raw file and i have to load in X sas tables by region. For loading it, we have to read, split, sorting and merging.&lt;BR /&gt;
I want to program it without having to put the regions manually. &lt;BR /&gt;
&lt;BR /&gt;
I have something like that:&lt;BR /&gt;
&lt;I&gt;&lt;BR /&gt;
data entry1 entry2 entry3;&lt;BR /&gt;
file 'XXXXXX';&lt;BR /&gt;
%include 'input format';&lt;BR /&gt;
array  RegionArr ('00','00','00');&lt;BR /&gt;
select region;&lt;BR /&gt;
when ('01') do;&lt;BR /&gt;
region(1) = RegionArr&lt;BR /&gt;
output entry1;&lt;BR /&gt;
end;&lt;BR /&gt;
when ('02') do;&lt;BR /&gt;
region(2) = RegionArr&lt;BR /&gt;
output entry2;&lt;BR /&gt;
end;&lt;BR /&gt;
...&lt;BR /&gt;
If final then do;&lt;/I&gt;&lt;BR /&gt;
   And here is my doubt how i could pass this array for using later in a do loop for sorting the data&lt;BR /&gt;
&lt;BR /&gt;
Something like;&lt;BR /&gt;
&lt;BR /&gt;
do i to dim(SclArray)&lt;BR /&gt;
proc sort data = 'entry'&amp;amp;i;   --&amp;gt; table work.entry1/2...&lt;BR /&gt;
   by ccc norden ordentra;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data = region||sclarray(i);  ---&amp;gt; rable region01/02/03...&lt;BR /&gt;
   by ccc norden ordentra;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
I know that i could make it thinking in other ways but i dont find how to do it.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks for all and sorry my english.</description>
      <pubDate>Fri, 12 Mar 2010 12:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67898#M14713</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-12T12:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67899#M14714</link>
      <description>Investigate using PROC SQL to generate a SAS macro variable containing a unique/distinct list of variable values.  Then in a %DO / %END macro code paragraph, iterate through the macro var value list to execute your other SAS code.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Recommended Google advanced search, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
proc sql select distinct into macro variable site:sas.com</description>
      <pubDate>Fri, 12 Mar 2010 12:50:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67899#M14714</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-12T12:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67900#M14715</link>
      <description>Thanks sbb,&lt;BR /&gt;
&lt;BR /&gt;
Usually i could resolve my doubts using google, but this is the first time i'm really really stuck.&lt;BR /&gt;
&lt;BR /&gt;
So i seen cleary that the only thing that i need is pass this at the end in data step (my boss want to do in this way)  array to macro array. I think the rest of the code i could investigate too. I'm not a lazy developer, but i think someone could know this (i preffer giving the tecnics for resolving and not the solution, but i'm a bit desperate)</description>
      <pubDate>Tue, 16 Mar 2010 14:19:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67900#M14715</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-16T14:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67901#M14716</link>
      <description>The fourth match in the Google search provided is right out of the PROC SQL DOC examples::&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a002595788.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a002595788.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Also, additional DOC discussion on using INTO clause:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000543554.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000543554.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 16 Mar 2010 14:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67901#M14716</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-16T14:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67902#M14717</link>
      <description>Thanks again&lt;BR /&gt;
&lt;BR /&gt;
BUT, BUT, my boss, want to do it in this way &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So Mr. Barry, do you know any way to pass a local array in a data step to a global array? or the proc sql + into is the only way to do this?&lt;BR /&gt;
If i can do it only for working i have it, BUT my boss want this way, and it's a really pitty. And as ia said i was invetistigatinv proc execute, but i dont really understand it, i'm new in macroworld.&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Sasvage

Message was edited by: Sasvage</description>
      <pubDate>Wed, 17 Mar 2010 07:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67902#M14717</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-17T07:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67903#M14718</link>
      <description>Your use of prhases like "local array" and "global array" are a bit concerning.  Can you explain what these references meam, both to yourself and for others?&lt;BR /&gt;
&lt;BR /&gt;
You have a CALL SYMPUT function to generate macro variables from a DATA step, in addition to what I have already suggested (with DOC reference) using PROC SQL.  This will "pass" information from one SAS step to another.&lt;BR /&gt;
&lt;BR /&gt;
Your scavenger hunt or "puzzle of the day" situations are not amusing to me.  I'd rather offer gudance to lead rather than attempt to pull someone with SAS coding practices.  Suggest you work with your bad-boy boss to move this concern forward and to some sort of end.  Also, the whining is unbecoming even with the bogus emoticons which I detest in these forums where they are a distraction, frankly.&lt;BR /&gt;
&lt;BR /&gt;
One individual's opinion..at full-throttle, of course.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 17 Mar 2010 09:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67903#M14718</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-03-17T09:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67904#M14719</link>
      <description>I know i was not enough polite, but the RTFM actitude doesn't solved nothing for me.&lt;BR /&gt;
As you said and i finally discovered by myself the calls ymput generate N variables like state1 state2.&lt;BR /&gt;
And seriusly and it's not a joke, i think you'll be a good boss. I have good one, but my solutions will be good until the next release, it's the kind of flexibility that workers hate.&lt;BR /&gt;
I will need the proc sql with :into in the future so thanks. I'm not sarcastic, believe me.</description>
      <pubDate>Wed, 17 Mar 2010 13:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67904#M14719</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-17T13:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67905#M14720</link>
      <description>Hi:&lt;BR /&gt;
  I agree with Scott that your use of terms like "local array" and "global array" show a misunderstanding of the fundamentals of SAS -- both about arrays and about macro variables. &lt;BR /&gt;
 &lt;BR /&gt;
  A SAS DATA step program allows you to treat a group of variables as members of an array for ease of processing and reference. So these are all valid DATA step array references:&lt;BR /&gt;
[pre]&lt;BR /&gt;
array lovelucy $ fred ethel lucy ricky;&lt;BR /&gt;
array regsl regsale1 regsale2 regsale3 regsale4;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
In a DATA step program you could use a DATA step DO loop to iterate through an array in order to perform some kind of processing. &lt;BR /&gt;
&lt;BR /&gt;
  The SAS Macro facility does NOT have any such construct. Although the Macro facility allows you to build numbered macro variables and although you can use a %DO loop to generate code from those numbered macro variables, there is no such thing in the SAS Macro facility as a "local array" or a "global array". There is only the GLOBAL symbol table and the LOCAL symbol table (if you are using LOCAL macro variables within a Macro program).&lt;BR /&gt;
&lt;BR /&gt;
 Sadly, as with many other knowledge areas, at some point, you do have to "read the manual". If the Macro facility documentation is not attractive, then you will have to read user group papers or books about the SAS Macro facility in order to do what you want to do. It is indeed possible to write a SAS macro program which would iterate through a list of numbered macro variables (one for each region) , generate a PROC SORT and then generate whatever other report code needed to be generated. Some people call this ability a macro "array" because, it acts -LIKE- an array, but technically, the macro facility does not have any explicit %ARRAY statement -- it is unnecessary given the fact that you can use %DO to iterate over a group of numbered Macro variables.&lt;BR /&gt;
&lt;BR /&gt;
Also confusing in your post is the reference to SCL?? Without knowing the context for using SCL (SAS/AF? BI Java application using Eclipse and SCL with Java beans?) it is hard to even start to talk about passing information from Base SAS to an SCL application, because SCL sometimes uses lists to hold information to be used for processing and that is an entirely separate topic.&lt;BR /&gt;
&lt;BR /&gt;
I don't understand your parting shot where you said:&lt;BR /&gt;
&lt;B&gt;but my solutions will be good until the next release, it's the kind of flexibility that workers hate&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
The SAS Macro facility has been around since the early days of SAS and macro programs that I wrote back in Version 5 and Version 6 are still running in Version 9.2 -- the underlying SAS code generated from the Macro programs has changed a bit to take advantage of new features and options, but the Macro facility, itself continues to work like a champ in my opinion.&lt;BR /&gt;
&lt;BR /&gt;
This paper is a very good introduction to the SAS Macro facility and fundamental concepts:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi28/056-28.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi28/056-28.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
And here are some other useful papers:&lt;BR /&gt;
&lt;A href="http://www.lexjansen.com/pnwsug/2004/c_cc_storing_and_using_a_lis.pdf" target="_blank"&gt;http://www.lexjansen.com/pnwsug/2004/c_cc_storing_and_using_a_lis.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.wuss.org/proceedings08/08WUSS%20Proceedings/papers/cod/cod06.pdf" target="_blank"&gt;http://www.wuss.org/proceedings08/08WUSS%20Proceedings/papers/cod/cod06.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi29/070-29.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi29/070-29.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi31/040-31.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi31/040-31.pdf&lt;/A&gt; ( in this paper, one user explains how he wrote his own %ARRAY macro program)&lt;BR /&gt;
&lt;BR /&gt;
Finally, some info on SCL lists:&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi23/Appdevel/p10.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi23/Appdevel/p10.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000147897.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000147897.htm&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000147904.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000147904.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 17 Mar 2010 16:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67905#M14720</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-03-17T16:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: Passing arrays between sas base and scl</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67906#M14721</link>
      <description>I see that beyond sas af i'm totally ignorant. I'm hurry for ending this development but i will read your post carefully.&lt;BR /&gt;
&lt;BR /&gt;
"but my solutions will be good until the next release, it's the kind of flexibility that workers hate"&lt;BR /&gt;
I can make the development using my methodology, but in the next year or next release i'm going to develop "as the boss says".</description>
      <pubDate>Mon, 22 Mar 2010 12:11:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-arrays-between-sas-base-and-scl/m-p/67906#M14721</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-03-22T12:11:38Z</dc:date>
    </item>
  </channel>
</rss>

