<?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: Upcase all data in the Excel file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26385#M6025</link>
    <description>I guess the key over here is to get the list of variable names from the dataset and then perform the upcase function.&lt;BR /&gt;
&lt;BR /&gt;
Following macro could serve the purpose&lt;BR /&gt;
&lt;BR /&gt;
%macro to_upcase(dataset);&lt;BR /&gt;
&lt;BR /&gt;
data Upcase;&lt;BR /&gt;
 set &amp;amp;dataset;&lt;BR /&gt;
	 &lt;BR /&gt;
%let num_vars=%sysfunc(attrn(&amp;amp;dsid.,nvars)); %let dsid=%sysfunc(open(&amp;amp;dataset,i)); &lt;BR /&gt;
%do i=1 %to &amp;amp;num_vars.;	                         &lt;BR /&gt;
%let vname=%sysfunc(varname(&amp;amp;dsid.,&amp;amp;i));  &lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;vname=upcase(&amp;amp;vname);&lt;BR /&gt;
%end;&lt;BR /&gt;
%let rc= %sysfunc(close(&amp;amp;dsid.));&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%to_upcase(&amp;lt;&amp;lt;dataset name&amp;gt;&amp;gt;);&lt;BR /&gt;
&lt;BR /&gt;
Refer  following documentation &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000212040.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000212040.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
-D</description>
    <pubDate>Wed, 03 Nov 2010 04:13:28 GMT</pubDate>
    <dc:creator>DCL</dc:creator>
    <dc:date>2010-11-03T04:13:28Z</dc:date>
    <item>
      <title>Upcase all data in the Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26383#M6023</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I need a piece of code which is capable to upcase all the datas in the Excel file.&lt;BR /&gt;
But my aim is this: i want to automize for all the datasets. I mean it should work for all distinct dataset column names.&lt;BR /&gt;
&lt;BR /&gt;
For example:&lt;BR /&gt;
i got a excel file which has two columns: ID NAME&lt;BR /&gt;
i got another excel file which has three columns: SURNAME SEX AGE&lt;BR /&gt;
&lt;BR /&gt;
So my function should work for all files by defining the column names at the start of the code.&lt;BR /&gt;
So i should say:&lt;BR /&gt;
my columns which should be upcased is (ID,NAME) or (SURNAME,SEX,AGE)&lt;BR /&gt;
&lt;BR /&gt;
And then this following code should upcase the column's data:&lt;BR /&gt;
&lt;BR /&gt;
newID=upcase(ID);&lt;BR /&gt;
newNAME=upcase(NAME);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Can someone help me to this job?&lt;BR /&gt;
&lt;BR /&gt;
Thanx in advance,&lt;BR /&gt;
Cakcan</description>
      <pubDate>Tue, 02 Nov 2010 12:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26383#M6023</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-11-02T12:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase all data in the Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26384#M6024</link>
      <description>One approach is to write a SAS macro that uses PROC SQL and DICTIONARY.COLUMNS to generate a list of SAS variable names to be used in a SAS DATA step for the UPCASE operation on each variable/observation value.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
generate code proc sql dictionary columns site:sas.com</description>
      <pubDate>Tue, 02 Nov 2010 14:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26384#M6024</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-11-02T14:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Upcase all data in the Excel file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26385#M6025</link>
      <description>I guess the key over here is to get the list of variable names from the dataset and then perform the upcase function.&lt;BR /&gt;
&lt;BR /&gt;
Following macro could serve the purpose&lt;BR /&gt;
&lt;BR /&gt;
%macro to_upcase(dataset);&lt;BR /&gt;
&lt;BR /&gt;
data Upcase;&lt;BR /&gt;
 set &amp;amp;dataset;&lt;BR /&gt;
	 &lt;BR /&gt;
%let num_vars=%sysfunc(attrn(&amp;amp;dsid.,nvars)); %let dsid=%sysfunc(open(&amp;amp;dataset,i)); &lt;BR /&gt;
%do i=1 %to &amp;amp;num_vars.;	                         &lt;BR /&gt;
%let vname=%sysfunc(varname(&amp;amp;dsid.,&amp;amp;i));  &lt;BR /&gt;
&lt;BR /&gt;
&amp;amp;vname=upcase(&amp;amp;vname);&lt;BR /&gt;
%end;&lt;BR /&gt;
%let rc= %sysfunc(close(&amp;amp;dsid.));&lt;BR /&gt;
 run;&lt;BR /&gt;
&lt;BR /&gt;
%mend;&lt;BR /&gt;
&lt;BR /&gt;
%to_upcase(&amp;lt;&amp;lt;dataset name&amp;gt;&amp;gt;);&lt;BR /&gt;
&lt;BR /&gt;
Refer  following documentation &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000212040.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000212040.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
-D</description>
      <pubDate>Wed, 03 Nov 2010 04:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Upcase-all-data-in-the-Excel-file/m-p/26385#M6025</guid>
      <dc:creator>DCL</dc:creator>
      <dc:date>2010-11-03T04:13:28Z</dc:date>
    </item>
  </channel>
</rss>

