<?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: SAS Macro Question-Please Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141891#M28473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps I am missing the forest for the trees here but it looks like you are copying values from the data set &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CDF_DEALER_OUT &lt;/SPAN&gt; to the data set RESULT through macro variables.&lt;/P&gt;&lt;P&gt;Why not just use data step code to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data results ;&lt;/P&gt;&lt;P&gt;if _n_=1 then set CDF_DEALER_OUT (firstobs=&amp;amp;i);&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jan 2015 13:57:26 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-01-28T13:57:26Z</dc:date>
    <item>
      <title>SAS Macro Question-Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141890#M28472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the code I have been using for Geocoding in SAS. As you can see, I can read only a few variables from CDF_DEALER_OUT dataset by assigning them to a macro. If I am having, say 200-300 variables, I am in a problem. What can I do if I need to have all the fields from CDF_DEALER_OUT in the final dataset:&amp;nbsp; Geocodes_CDF. Greatly appreciate the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro&amp;nbsp; Geocd;&lt;BR /&gt;%do&amp;nbsp; i= 1&amp;nbsp;&amp;nbsp; %to&amp;nbsp; &amp;amp;tot; &lt;BR /&gt;data _null_;&lt;BR /&gt;nrec= &amp;amp;i;&lt;BR /&gt;set CDF_DEALER_OUT point=nrec;&lt;BR /&gt;call symput('a1',translate(trim(address_old),'+',' '));&lt;BR /&gt;call symput('add',trim(address_old));&lt;BR /&gt;call symput('add1',trim("Street Address"n));&lt;BR /&gt;call symput('city',trim(city));&lt;BR /&gt;call symput('zip',trim("Post/Zip Code"n));&lt;BR /&gt;call symput('country',trim(Country));&lt;BR /&gt;stop;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename y url "&lt;A href="https://communities.sas.com/"&gt;http://maps.google.com/maps/api/geocode/xml?address=&amp;amp;a1.%nrstr(&amp;amp;sensor=true&lt;/A&gt;)";&lt;/P&gt;&lt;P&gt;*Save the XML code to a file and create an XML Map;&lt;BR /&gt;filename&amp;nbsp; Googlexm 'C:\Nitish\Canada\Googlexml3.xml';&lt;/P&gt;&lt;P&gt;/*if it a poor match then google will either return status= no ok? or produce more than one match*/&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;infile y lrecl= 32000 pad;&lt;BR /&gt;input;&lt;BR /&gt;file Googlexm;&lt;BR /&gt;put _infile_;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *******XML code;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*XML Map tells the XML engine how to map XML markup to a SAS dataset;&lt;BR /&gt;filename&amp;nbsp; SXLEMAP 'C:\Nitish\Canada\Googlexmlmap3.map';&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;*Use XML engine in LIBNAME statement to read the XML file;&lt;BR /&gt;libname Googlexm xml xmlmap=SXLEMAP access=READONLY;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;data results;&lt;BR /&gt;length Address_Old $ 200 "Street Address"n $ 92 City $ 29 "Post/Zip Code"n 8 Country $ 20 URL $ 300;&lt;BR /&gt;Address_Old=symget( 'Add');&lt;BR /&gt;"Street Address"n=symget('Add1');&lt;BR /&gt;City=symget('City');&lt;BR /&gt;"Post/Zip Code"n=symget('Zip');&lt;BR /&gt;Country=symget('Country');&lt;BR /&gt;URL="&lt;A href="https://communities.sas.com/"&gt;http://maps.google.com/maps/api/geocode/xml?address=&amp;amp;a1.%nrstr(&amp;amp;sensor=true&lt;/A&gt;)";&lt;BR /&gt;set&amp;nbsp; Googlexm.result(rename=(Formatted_Address=Address_Cleaned));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;*Dataset to hold all geocoded lat and lng;&lt;BR /&gt;data Geocodes_CDF;&lt;BR /&gt;set&amp;nbsp; Geocodes_CDF results;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;BR /&gt;time_wait=sleep(2) ;&amp;nbsp;&amp;nbsp; ******Sleep 2 seconds;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend&amp;nbsp; Geocd; &lt;BR /&gt;%Geocd;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 13:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141890#M28472</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2015-01-28T13:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Question-Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141891#M28473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps I am missing the forest for the trees here but it looks like you are copying values from the data set &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;CDF_DEALER_OUT &lt;/SPAN&gt; to the data set RESULT through macro variables.&lt;/P&gt;&lt;P&gt;Why not just use data step code to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data results ;&lt;/P&gt;&lt;P&gt;if _n_=1 then set CDF_DEALER_OUT (firstobs=&amp;amp;i);&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jan 2015 13:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141891#M28473</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-01-28T13:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro Question-Please Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141892#M28474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help Tom. Your logic did help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 15:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Question-Please-Help/m-p/141892#M28474</guid>
      <dc:creator>sasmaverick</dc:creator>
      <dc:date>2015-02-04T15:18:03Z</dc:date>
    </item>
  </channel>
</rss>

