<?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>Vince28_Statcan Tracker</title>
    <link>https://communities.sas.com/kntur85557/tracker</link>
    <description>Vince28_Statcan Tracker</description>
    <pubDate>Sat, 30 May 2026 05:49:22 GMT</pubDate>
    <dc:date>2026-05-30T05:49:22Z</dc:date>
    <item>
      <title>Re: How to import this SDMX-ML data from Statistics Canada in SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-import-this-SDMX-ML-data-from-Statistics-Canada-in-SAS/m-p/169547#M43859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Morglum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad to see non governmental users tap into our dissemination data. I am not posting on behalf of Statscan but myself only. Fereeza kindly pointed out the issue via e-mail. Our dissemination formats for complete files are indeed not the simplest to load directly into SAS. The beyond20/20 option is a good alternative for users that may not have the corporate IT infrastructure to use external XML tools and expertise to handle SDMX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, from personal experience on a project a few months ago where I was waiting for a database access and ran out of patience and extracted a SDMX which contained the specific information I needed at that point in time, I can say that it is feasible to import the SDMX files directly into SAS. Our dissemination website provides links to SDMX documentation but the basic gist is that the STRUCTURE file is metadata about the main file namely in terms of codesets definitions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The SAS xml engine uses sequential access and thus shouldn't have any issue handling large files&lt;/STRONG&gt;. As a matter of fact, I modified slightly my .map file from a few months back and extracted the ~35M records from the data file into SAS via only the XML engine before coming here to comment. SDMX however does not comply to the GENERIC xml in the xml libname engine documentation hence why you specifically need to build a custom XMLMAP for the job and the libname statement in your original post did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good place to get started in a scenario like this is to read the XML file as a text file via INFILE statement, put that into a large enough variable and limit yourself with OBS= infile option (I use between 100-1000). Then in another datastep output that into a different file to check the xml structure without crashing windows from out of memory exception because most default xml viewers would load the entire 15gb file into memory. Use a simple text viewer to see the structure and build your custom XMLMAP with it. There are different ways to map the file and then transform it into what you wish to obtain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have tried the XML map option at some point but that it failed and that failure wasn't caused by a faulty .map file, it might be because of the XML file encoding or because you did not expand logical record length (LRECL= option) for the file and the XML structure broke down from truncation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc groovy is a layer to call java from within SAS. There probably exists a free java class online that reads SDMX - I wouldn't know where to begin to look. The data step component object Java Object could've been used in a similar way but again that requires some external java expertise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad to see you managed to import the data. I just came by to share that it is possible to import into SAS via custom xmlmap with some effort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Aug 2014 17:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-import-this-SDMX-ML-data-from-Statistics-Canada-in-SAS/m-p/169547#M43859</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-08-22T17:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using the XML Mapper Utility</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-the-XML-Mapper-Utility/m-p/144066#M38322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't seem to open the XML links but given the construct in your post, you should be able to read that with the mapper in 2 different ways. The simplest being to make sure that your&lt;/P&gt;&lt;P&gt;&amp;lt;TABLE-PATH&amp;gt;&lt;/P&gt;&lt;P&gt;has tue full hierarchy all the way up to and including /contract&lt;/P&gt;&lt;P&gt;&amp;lt;/TABLE-PATH&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This acts as your row-creating driver. That is, doing so you will have one row created in your dataset each time you run through this hierarchy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second thing to do is to define the column SYMBOL using the options retain and replace like&lt;/P&gt;&lt;P&gt;&amp;lt;COLUMN name="SYMBOL" retain="yes" replace="yes"&amp;gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;lt;/COLUMN&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These 2 things combined should allow you to easily create the desired table from the specified xml. If you can specify the full x-path to /contract (since I can't seem to view the xml link), I can probably provide you with a .map file that will meet your requirements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 May 2014 13:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-the-XML-Mapper-Utility/m-p/144066#M38322</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-05-06T13:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Analysis by row</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Analysis-by-row/m-p/177022#M45350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well this may be a little simplistic but as I don't know the full extent of your data structure, here's how you can work it out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;step 1. Proc Sort by Name, Loan_Pos&amp;nbsp; /* name or whatever other unique client ID you have */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;step 2. Data step using BY group on Name (or whatever other unique client ID you have */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if first.name then output table1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else output table2;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can have significantly more than 2 loans per individuals and your problem is more complex than that, you would need to throw in an example of a "worst case scenario" where you want to distribute X records over Y files according to some logic like you've described.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 13:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Analysis-by-row/m-p/177022#M45350</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-04-11T13:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS converting character variables to numeric while exporting to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-converting-character-variables-to-numeric-while-exporting-to/m-p/157609#M263025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alternatively, you could also use RW9's approach with throwing double quotes around but then further more adding an = sign in front of each text string such that instead of having&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name,valuec,valuen&lt;/P&gt;&lt;P&gt;"Vincent","12345678901234567890",12345678901234567890&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name,valuec,valuen&lt;/P&gt;&lt;P&gt;="Vincent",="12345678901234567890",=12345678901234567890&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading the equal sign in a cell will tell excel it is a formula. In the case of a string formula aka "12345678901234567890", it will then only display it as a string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 17:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-converting-character-variables-to-numeric-while-exporting-to/m-p/157609#M263025</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-03-26T17:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS converting character variables to numeric while exporting to CSV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-converting-character-variables-to-numeric-while-exporting-to/m-p/157608#M263024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excel is doing the formating/calculations (yes sadly it calculates and potentially loses precision).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Upon opening the CSV in excel,&lt;/P&gt;&lt;P&gt;1. go to the main menu&lt;/P&gt;&lt;P&gt;2. excel options&lt;/P&gt;&lt;P&gt;3. advanced&lt;/P&gt;&lt;P&gt;4. under display options for this worksheet click show formulas in cells instead of their calculated values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There might be some details online to have this set as the default when you open excel but I don't think you could help it on other people's desktop using CSV. CSV contains no metadata and its up to whatever software you use to open it to chose how it does so. Sadly, MS tries so much to accomodate people in having to do less manipulation that they best guess format and calculation wrong, even with DSD (quotes around strings).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 17:23:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-converting-character-variables-to-numeric-while-exporting-to/m-p/157608#M263024</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-03-26T17:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: If then statement to case statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-then-statement-to-case-statement/m-p/154262#M30257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are some inconsistencies with your output table versus the logic. You might want to review both. Examples of it would be row1 flag1 num_var1 is not in (4,5) which makes the condition &lt;STRONG&gt;if table1.num_varn not in (4,5) or table2.charvarn in&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG&gt;(table2.char_var)&lt;/STRONG&gt; as true and thus the flag should be 0, not 1. My first guess was that you should've had an AND instead of an OR between the two conditions. However, this was also rejected by row2/flag4 because this would evaluate to true even if the OR had been replaced by an AND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I can still provide conceptual grounds for you to work with. The concept of "... in table2.char_var" can be achieved through the use of subquerries as pointed out above. The SQL syntax looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;table1.charvarn in (select char_var from table2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This turns the subquerry in parenthesis as a list of values for the in operator. That is, it's as though the subquerry in the parenthesis resolves to ('a', 'b', 'c', 'd') from the example data above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 16:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-then-statement-to-case-statement/m-p/154262#M30257</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-03-24T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: using %sysfunc(cat() )</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-sysfunc-cat/m-p/191079#M36044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Explanation of your error as the proper fix was covered by Quentin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As with data step DO loops, the %DO also ends by iterating one beyond the end of loop criterion. So at the end of the %do loop &amp;amp;K is effectively 5. You can create a dataset with a do loop and not drop the counter variable and see for yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the issue with your code is that the macro first writes the following code during macro compilation phase and then executes this datastep code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wilcox1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wil_stat1=resolve('&amp;amp;&amp;amp;wilstat&amp;amp;k');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_val4=resolve('&amp;amp;&amp;amp;pval&amp;amp;k');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is, the resolve function resolves macro variable at data step execution phase rather than macro compilation phase as it was within your %sysfunc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So timeliness wise, since the data step is executed after the macro code has been resolved, your code effectively turns into this conceptual hardcoded datastep with only macro variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data wilcox1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wil_stat1=&amp;amp;wilstat5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_val1=&amp;amp;pval5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wil_stat1=&amp;amp;wilstat5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_val1=&amp;amp;pval5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wil_stat1=&amp;amp;wilstat5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_val1=&amp;amp;pval5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wil_stat1=&amp;amp;wilstat5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_val1=&amp;amp;pval5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the error lies in using the resolve function and the corrections were covered by Quentin and Reeza.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 20:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-sysfunc-cat/m-p/191079#M36044</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-02-28T20:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc contents</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-contents/m-p/191141#M14609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc contents is a hidden call to proc datasets with content statements. If you follow through the documentation of proc contents for DATA= option, you will find that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=jim._ALL_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should achieve your desired result. The notice for the MEMTYPE= in the documentation only applies if you want proc contents for library members that are not datasets as those are the default member types output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are looking only for a particular element of information from proc contents though, the SASHELP tables mentionned by Reeza are probably a better alternative if you have many, many datasets in your library.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Feb 2014 20:35:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/proc-contents/m-p/191141#M14609</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-02-28T20:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sas merge help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sas-merge-help/m-p/152516#M40116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You simply need to use a join statement for your desired result. My original reply should provide exactly this without the specific ordering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add an order by statement with either the appropriate variable names like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order by t2.id2, t1.id, t1.code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or reuse the syntax by ctorres of using column numbers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order by 1,2,3 will use the columns produced by the merge so 1 is equivalent to t2.id2 because that is the first one in the select statement. t1.* means all variable from source t1 so they would be in the exact same order as they were in the source meaning 2 is equivalent to t1.ID and 3 is equivalent to t1.code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All in all, my original code will achieve the merge you ought to do. Sortation can either be embeded in the proc sql through order by statement or you could've simply ran a proc sort on the table produced by my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 18:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sas-merge-help/m-p/152516#M40116</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-24T18:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sas merge help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Sas-merge-help/m-p/152512#M40112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi Cypher,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Technically, this is a many-to-many merge over the key ID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly, this is not achiveable with a data step MERGE statement. The natural alternative is to use proc sql;. There are 2 options for data step, one is to manually control the merge with multiple set statements and whatnot. This is extremely tedious and error prone. The other one is to use the hash object with multidata: 'YES' option. However, this is memory dependant and while it may offer improved execution time, it is more transferable to use proc sql and also far better to learn proc sql before hash objects in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sql code would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select t2.ID2, t1.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dataset1 as t1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataset2 as t2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on t1.id = t2.id;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join is subjective as your data didn't have any nonmatch to figure out whether left/right/inner/full joins would've been the best pick&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 17:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Sas-merge-help/m-p/152512#M40112</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-24T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to do left  join in sas dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-do-left-join-in-sas-dataset/m-p/144603#M38421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would first need to check your syntax and error log if a piece of code does not work. If it doesn't produce expected results, then it might be a functionality does not oblige to your requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select label, value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dataSet1 left join dataSet2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on start&amp;lt;=value&amp;lt;=end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order &lt;STRONG&gt;by&lt;/STRONG&gt; start;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also typically a good practice when using SQL to use the dot notation to prefix variable names as per their source i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.label, a.value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dataSet1 as a left join dataSet2 as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on b.start&amp;lt;=a.value&amp;lt;=b.end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by a.label&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order &lt;STRONG&gt;by&lt;/STRONG&gt; b.start;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additionally, I don't think (but I might be wrong here) that SQL standards use the group by statement in a similar fashion to SAS data step with a merge statement. That is, to achieve the equivalent by statement, you would normally want to have something like&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.label, a.value&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from dataSet1 as a left join dataSet2 as b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp; &lt;STRONG&gt;a.label=b.label and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.start&amp;lt;=a.value&amp;lt;=b.end&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by a.label&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order &lt;STRONG&gt;by&lt;/STRONG&gt; b.start;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore there is an ambiguity with your order by statement (At least based on my best guess of what you were trying to achieve) since the LEFT join retains records from dataset1 which did not match and thus have no start and end values tied to the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SQL group by statement is used to define what summary functions "sumarize by". The general idea is that all variables in the group by statement are found in the select statement and all other variables in the select statement use sumary functions so as to generate a single record per group by unique key. Otherwise, you generate a cartesian product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beyond that, I must agree with LinusH. Data step is not appropriate for all merges and it is why proc sql exists and is built in sas. It might be viable depending on your data but likely not as it is even less fuzz match friendly than proc sql (the fuzz occur with start&amp;lt;=value&amp;lt;=end condition). Other data step alternatives involving hash object are more flexible in terms of what can be achieved (when compared with a merge statement) but it is best to be familiar with proc sql prior to getting into the hash object as the object has memory limitations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2014 14:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-do-left-join-in-sas-dataset/m-p/144603#M38421</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-17T14:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: The %DO statement is not valid in open code.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-The-DO-statement-is-not-valid-in-open-code/m-p/143463#M261737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following code works just fine when testing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%MACRO DO_BRANCH;&lt;/P&gt;&lt;P&gt;%do u=1 %to 20;&lt;/P&gt;&lt;P&gt;proc surveyselect data=sashelp.class&amp;nbsp; method = urs sampsize = 14 OUTHITS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reps=1 seed=1234100 out=new_&amp;amp;u;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%MEND DO_BRANCH;&lt;/P&gt;&lt;P&gt;%DO_BRANCH;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, 2 important things to note. Since all procedure resets to the start of the seed, your current implementation would yield new_1=new_2=...=new_20. That is, the exact same 141 records would be selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect its the part in CODES... that triggers your empty new_2 to new_20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As DN pointed out, a more natural approach would be to use REPS=20 and then split the resulting file BY REPLICATE (the automatically generated variable listing the count of REPS). This would clear your issue with having to change seeds each time as then it keeps on drawing numbers from the same seed rather than reseting at the beginning of the seed for each procedure iteration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 20:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-The-DO-statement-is-not-valid-in-open-code/m-p/143463#M261737</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-16T20:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Amortization Schedule Using Array?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Amortization-Schedule-Using-Array/m-p/189245#M35718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt; array loan_bal{0:72};&lt;/P&gt;&lt;P&gt; loan_bal{0}=amf; /* initiate debt */&lt;/P&gt;&lt;P&gt; do i=1 to 72;&lt;/P&gt;&lt;P&gt;&amp;nbsp; loan_bal{i}=loan_bal{i-1}-(pmt-(loan_bal{i-1}*(rate/12)));&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by explicitely definining the array index starting with 0, you handle start&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however, this implementation does not handle the last partial payment nor the possibility that loan_bal{i} goes below 0 if term &amp;lt; 72 months but the "lag to prev value" is there and working. The where statement is in a distinct category from the IF statement as far as implementing logic goes in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 19:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Amortization-Schedule-Using-Array/m-p/189245#M35718</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-07T19:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Excel commands via DDE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-commands-via-DDE/m-p/189525#M13005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/thread/49210"&gt;https://communities.sas.com/thread/49210&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my last post or follow the following link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small active_link" href="http://support.microsoft.com/kb/128185/en-us"&gt;http://support.microsoft.com/kb/128185/en-us&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jan 2014 15:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Excel-commands-via-DDE/m-p/189525#M13005</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-07T15:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Select observations that meet a criteria</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-observations-that-meet-a-criteria/m-p/187393#M304021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As PG has examplified by-group processing, I will only answer the hash portion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS Hash Object is a fairly recent feature. It is essentially a "lookup table" that is usable through the data step. The strength of Hashing for the specific question you've asked is that if your data wasn't already sorted according to your by-group, then a hash solution alleviates the need to pre-sort (which often is the lenghtiest part of a simple by-group process). However, the hash object is fully held in memory throughout the data step so if you have a very, very large volume of data, it is possible to face an "out of memory" error with hash solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntaxically, it also looks confusing at first glance but one gets familiar with the programing syntax quite fast. Since you mentioned you were fairly new to SAS, it is probably best to get accustomed at least to by-group processing before looking at hashing. Hashing can achieve far more than just this but since it is memory-limited, it is wiser to learn the processing tools that should work "all around". So I will refrain from providing a hash solution. There are plenty of similar examples around these forums anyway and in various SGF papers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to add one element to Keith's description above, procedures have various built-in output. Unless tasked otherwise, the output statement in proc summary outputs outputs many more statistics than just maximum. Using output statement options allows you to control that default behaviour. See proc summary -&amp;gt; output statement documentation (it will actually point you towards proc means' output statement as they have the same options). You will find the specific explanation for the MAXID option there and how it applies the max on X, by class HH_NO but will actually output PI_No and X as the identifier for that maximum point found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 17:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-observations-that-meet-a-criteria/m-p/187393#M304021</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-06T17:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: sort columns from lft to right after proc transpose</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/sort-columns-from-lft-to-right-after-proc-transpose/m-p/187672#M47598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Transpose creates variables in the order they are encountered in the variable(s) used to create new ones after the transpose. There are different approaches to tackle the problem depending on how large a file and how long it takes to process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could consider adding a "dummy" record to your untransposed file at the very beginning of the file recreating the desired dates in descending order instead of the ascending order it naturally gets updated. You could also proc sort descending or order by desc on your date variable before transposing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, you could use the transposed dataset and recreate a new dataset with the variables in a different order after the shot. This can be done with some macros, the dictionary tables and a keep statement or really anything that will make the data step encounter the variables name in the order you want them to be before the set statement. I will only examplify this very case simply as its the only one that requires some more complex programming statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :dt1-:dt9999&amp;nbsp;&amp;nbsp;&amp;nbsp; /* generic upper boundary on the number of date variables - only the necessary macro vars will be created */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.vcolumn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname="WORK" /* or whatever library your NOW dataset is stored in */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and memname = "NOW"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and prxmatch("m/^[A-Za-z]{3}[0-9]{4}/", name)&amp;gt;0 /* validates that the variable name is following 3 char 4 digit patterns. If you have other odd variable names you could be more specific and build a list of 3 letter prefixes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; corresponding to months or do further year processing in the regular expression. I assumed it was not required */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let ndates=&amp;amp;sqlobs; /* to be able to loop on dt1-dt&amp;amp;sqlobs. after other subsequent proc sql */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :leads separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from sashelp.vcolumn&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname="WORK" /* or whatever library your NOW dataset is stored in */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and memname = "NOW"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and prxmatch("m/^[A-Za-z]{3}[0-9]{4}/", name)=0 /* other non-match variables will be put in front of all date vars, you can change this rule if only a few specific variables are to be leads that is merely my assumption of your&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intentions */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro write();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data NEXT_MONTH;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keep &amp;amp;leads.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %do i=&amp;amp;ndates. %to 1 %by -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;dt&amp;amp;i..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; /* to close the keep statement */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set NOW;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%write();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all untested so there might be some syntax errors but the idea is all there. Please note that SASHELP.VCOLUMN is naturally sorted by column number hence the reverse %do loop. There are alternative approaches like grouping and ordering inside the proc sql "descending" and then doing a regular %do loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/sort-columns-from-lft-to-right-after-proc-transpose/m-p/187672#M47598</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-03T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select observations that meet a criteria</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-observations-that-meet-a-criteria/m-p/187388#M304016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The issue although it may also be the desired result as it was not specified, is that if you have 2 distinct PI_NO with the same x=max(x) value, you will output both with that proc sql approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, depending on the size of your data, using proc summary instead of a data step or sql solution could take far more time than it should.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, depending on the size of your data and whether it is already pre-sorted by HH_NO or not, there are hash solutions, by group processing with point= solution and others that could get you faster processing and solve the proc sql potential duplicate HH_NO issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So anyway if the solutions above run too slow or don't fully comply with your requirement, I will gladly provide either a hash or by processing solution but just in case you did not have such a huge dataset and either the above worked, I'll wait for a reply to provide an alternative solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-observations-that-meet-a-criteria/m-p/187388#M304016</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-03T14:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem using Input to convert char with missing values to num</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-using-Input-to-convert-char-with-missing-values-to-num/m-p/187205#M35446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;building upon appropriate input is typically better than the first solution as multiplying char by numeric issues a warning in the log and those should be avoided for any large process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could you provide a datalines example with data that does not get input properly by solution #2? Odds are you can apply some simple string function to WERT inside the input function to make it inputable appropriately. Likely strip to remove blanks or possibly the same solution you've mentionned using an alternative input format after removal of periods.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-using-Input-to-convert-char-with-missing-values-to-num/m-p/187205#M35446</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-03T14:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template can handle next case?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-template-can-handle-next-case/m-p/185200#M47045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Well, since you are stuck with SAS9.1.3, I'm affraid you will have to stick to the data step approach. You should be able to use macros and dictionary tables to at least relieve some of the coding burden of your table with 100 columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not knowledge enough of proc template to tell you with certainty that it can be achieved or not but realistically though, I don't see how it could be faster than a data step with a single read on the data. I've spent a bit of time looking at proc template documentation yesterday as I had been meaning to learn the basics of it for a long time but could never find a project that required it.It turns out that even if you were to define a tagset specific to your task in proc template and then use proc print to do the output, proc print still has a lot of additionnal processing going on that does not occur in a data step. There are tons of Events that drive the output layout and since proc template is really meant to be a visual output/reporting/graphing tool much more than a flat file output, any custom template reuses the ODS-driven events that are bound to the procedures with output. Anyway in short, even if you did spend the time to build a custom tagset, it should still be slower than the data step solution you've posted originally as it will necessarily involve a lot of additionnal dynamic processing of ODS-driven procedure events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the line in "What's new in SAS9.2 XML libname engine" discussing the new XMLMap feature for exporting purpose (it worked for imports with the XML libname engine but export was only implemented for engine XML92)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE cellpadding="0" cellspacing="0" width="100%"&gt;&lt;TBODY&gt;&lt;TR valign="top"&gt;&lt;TD class="title2"&gt;&lt;A name="a002910993"&gt;New XMLMap &lt;BR /&gt;Functionality&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XMLMap functionality has the following enhancements for the &lt;SPAN class="strongMono"&gt;XML92&lt;/SPAN&gt; engine nickname:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;BR /&gt;You can now export an XML document from a SAS data set using the XMLMap that &lt;BR /&gt;was created to import the XML document. The XMLMap tells the XML engine how to &lt;BR /&gt;map the SAS format (variables and observations) into the specific XML document &lt;BR /&gt;structure. See &lt;A _jive_internal="true" href="https://communities.sas.com/ms-its:engxml.chm::/engxml.hlp/a002594362.htm"&gt;Exporting &lt;BR /&gt;XML Documents Using an XMLMap&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 13:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-template-can-handle-next-case/m-p/185200#M47045</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-03T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc template can handle next case?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-template-can-handle-next-case/m-p/185197#M47042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alright I got to give it a go earlier than expected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Linked files are those relevant to your objectives. This was done in SAS9.2 and I don't think the xml engine was fully functional before then (at least not the xml92 engine). It further got improved with SAS9.3 if you need to create multiple files but I don't have it installed so you'd need to look at documentation as otherwise, you would need to create 1 libname statement per output file desired (even if they used the same map) whereas I believe from reading about it a while back the SAS9.3 improvements help alleviate that at least for input, maybe not for output though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please notice the "thisnamemustmatch" both in the sas code and in the map file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the &amp;lt;TABLE name="thisnamemustmatch"&amp;gt; tag in the map HAS to be the same as the data set output name that you used with your xml engine as otherwise it causes a client crash. You can name it however you want - it does not appear in the output xml anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As to provide some brief indications to adapt it to your desired solutions on how to write the map:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLE-PATH is essentially what dictates how often records are created for extraction and thus conversely impacts how the xml output appears. For example, test the same code with the map only altering&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/Table/RECORD&amp;lt;/TABLE-PATH&amp;gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;TABLE-PATH syntax="XPath"&amp;gt;/Table&amp;lt;/TABLE-PATH&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and see the difference in the output xml file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well, if you have hierarchical data that has columns "carried over" - think a household survey where you have one tag with all household level data and then many subtags with person-level data - If you were to create a person-level table that keeps all the household level data for each record, you'd have to add retain="YES" attribute to all of the COLUMN tags which use household-level data in the map. However, for export which is what your original request was, this is somewhat moot as per the requirement of 2D tables. You would've needed to merge a household table with a person table into a single table with repeated household data for each person before exporting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I don't think it is possible to use _N_ directly as a column to export. However, unless the existing sortation is absolutely essential to save, it is fairly typical not even to bother with an instance= attribute or the like as it is not required to import the data back into SAS. In particular, you could even create a new rowid at extraction time even if you did not create an instance= attribute using &amp;lt;INCREMENT-PATH&amp;gt; subtags of the &amp;lt;COLUMN&amp;gt; tag in the map. That is, the xml engine is able to mimic a _N_ column at extraction time and since it reads and writes the data sequentially, the numbers would be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps and that my comments aren't all too confusing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 14:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-template-can-handle-next-case/m-p/185197#M47042</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2014-01-02T14:31:36Z</dc:date>
    </item>
  </channel>
</rss>

