<?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: ODS excel proc print variable format in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7122#M2696</link>
    <description>Hello Andre,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your idea. I tested your code as is and it work very well. But I am still a newbie to SQL and when I substitute the libname and memname with a test sasdataset 'clean8' in c:\. The SQL indicated the &amp;amp;list is not resolved:&lt;BR /&gt;
&lt;BR /&gt;
15   proc sql noprint;&lt;BR /&gt;
16   select name into :list separated by ' ' from dictionary.columns&lt;BR /&gt;
17   where libname="C:\"&lt;BR /&gt;
18   and memname="clean8";&lt;BR /&gt;
NOTE: No rows were selected.&lt;BR /&gt;
19   run;&lt;BR /&gt;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;
20   quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
WARNING: Apparent symbolic reference LIST not resolved.&lt;BR /&gt;
21   %put &amp;amp;list;&lt;BR /&gt;
&amp;amp;lis&lt;BR /&gt;
&lt;BR /&gt;
Do you know what my error is ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
    <pubDate>Mon, 25 Feb 2008 16:25:59 GMT</pubDate>
    <dc:creator>Kwok</dc:creator>
    <dc:date>2008-02-25T16:25:59Z</dc:date>
    <item>
      <title>ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7120#M2694</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have to output a dataset with 68 variables to ODS Excel tagset and one of the vaiable require the format style={"mso-number-format:$#,###,###.##"};&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
For example,&lt;BR /&gt;
ODS Tagsets Excelxp..... ;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
ODS close; run;&lt;BR /&gt;
&lt;BR /&gt;
But if I need to format a variable( for example , the 23th) then I have to&lt;BR /&gt;
ODS Tagsets Excelxp..... ;&lt;BR /&gt;
proc print;&lt;BR /&gt;
 Var var1,var2,var3....var22;&lt;BR /&gt;
 var var23 / style(data)={tagattr="format:$###,###,###.00"};      &lt;BR /&gt;
 var var24, var25... var68; &lt;BR /&gt;
run;&lt;BR /&gt;
ODS close; run;&lt;BR /&gt;
&lt;BR /&gt;
Any tip or trick to avoid to write out all the variables, especially when the variable names are long.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Mon, 25 Feb 2008 13:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7120#M2694</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2008-02-25T13:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7121#M2695</link>
      <description>Use this program before  replace the field with correct upcase informations&lt;BR /&gt;
go then on the log to copy/paste your list of variables&lt;BR /&gt;
&lt;BR /&gt;
into  you multiple var statements in your ods tagsets part&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
select name into :list separated by ' '&lt;BR /&gt;
from dictionary.columns&lt;BR /&gt;
 where libname="SASHELP" and memname="CLASS";&lt;BR /&gt;
run;&lt;BR /&gt;
quit;&lt;BR /&gt;
%put &amp;amp;list;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 25 Feb 2008 14:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7121#M2695</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2008-02-25T14:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7122#M2696</link>
      <description>Hello Andre,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your idea. I tested your code as is and it work very well. But I am still a newbie to SQL and when I substitute the libname and memname with a test sasdataset 'clean8' in c:\. The SQL indicated the &amp;amp;list is not resolved:&lt;BR /&gt;
&lt;BR /&gt;
15   proc sql noprint;&lt;BR /&gt;
16   select name into :list separated by ' ' from dictionary.columns&lt;BR /&gt;
17   where libname="C:\"&lt;BR /&gt;
18   and memname="clean8";&lt;BR /&gt;
NOTE: No rows were selected.&lt;BR /&gt;
19   run;&lt;BR /&gt;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;
20   quit;&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
WARNING: Apparent symbolic reference LIST not resolved.&lt;BR /&gt;
21   %put &amp;amp;list;&lt;BR /&gt;
&amp;amp;lis&lt;BR /&gt;
&lt;BR /&gt;
Do you know what my error is ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Mon, 25 Feb 2008 16:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7122#M2696</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2008-02-25T16:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7123#M2697</link>
      <description>You were asking text generation corresponding to &lt;BR /&gt;
a libname and a table to use inside a proc print&lt;BR /&gt;
&lt;BR /&gt;
of course    c:\     is not a libref  which must be written in upcase&lt;BR /&gt;
and clean8   is not in upcase and is perhaps a table name  reachable only if you have passed a libname previous&lt;BR /&gt;
&lt;BR /&gt;
so correct your input, please&lt;BR /&gt;
&lt;BR /&gt;
Andre</description>
      <pubDate>Mon, 25 Feb 2008 16:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7123#M2697</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2008-02-25T16:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7124#M2698</link>
      <description>Hi:&lt;BR /&gt;
  The LIBNAME and MEMNAME should always be in caps...when you're querying any of the dictionary tables (dictionary.columns, etc). So your memname should be CLEAN8. The libname is not C:\ ... remember that a libname is just a nickname for a directory/folder location on your disk. So in this case:&lt;BR /&gt;
[pre]&lt;BR /&gt;
libname wombat 'c:\temp\mydata';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
WOMBAT is the nickname given to the directory path c:\temp\mydata. The 2 level name of a SAS dataset in this location will be WOMBAT.xxxxxxxx where the first level of the name is the nickname that is in the LIBNAME statement. The second level of the name (xxxxxxxx) will be the SAS dataset name.&lt;BR /&gt;
 &lt;BR /&gt;
Let's say that I go out to the directory and look in c:\temp\mydata folder and I find 3 SAS datasets -- I can tell they're SAS datasets (in version 8 and 9) because they will have a file extension of SAS7BDAT...so I have these files:&lt;BR /&gt;
c:\temp\mydata\account.sas7bdat&lt;BR /&gt;
c:\temp\mydata\members.sas7bdat&lt;BR /&gt;
c:\temp\mydata\updates.sas7bdat&lt;BR /&gt;
&lt;BR /&gt;
The 2 level name of each of these files would be:&lt;BR /&gt;
WOMBAT.ACCOUNT&lt;BR /&gt;
WOMBAT.MEMBERS&lt;BR /&gt;
WOMBAT.UPDATES&lt;BR /&gt;
 &lt;BR /&gt;
Notice how the libname/nickname 'WOMBAT' takes the place of the high level directory path and the data set name, ACCOUNT or MEMBERS or UPDATES becomes the second level of the 2-level name.&lt;BR /&gt;
 &lt;BR /&gt;
If you are creating a temporary data set, and you refer to it in your program by a ONE level name...something like this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc print data=clean8;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
then the "official" LIBNAME of your data set is 'WORK' and the 'official" 2-level name of your file is WORK.CLEAN8. So in your case, you might have a query with:&lt;BR /&gt;
where libname = 'WORK' and memname='CLEAN8';&lt;BR /&gt;
&lt;BR /&gt;
You say that your test sas data set is in c:\  -- look in your program for a LIBNAME statement, or if you don't have one, try this:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
libname mydata 'c:\';&lt;BR /&gt;
&lt;BR /&gt;
proc contents data=mydata._all_;&lt;BR /&gt;
  title 'What SAS datasets are in C:\';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
&lt;BR /&gt;
Now, look in the output from the PROC CONTENTS to make sure that your file, CLEAN8 is in that directory location. If it IS in the list, then your query would be:&lt;BR /&gt;
[pre]&lt;BR /&gt;
where libname = 'MYDATA' and memname='CLEAN8';&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
If your CLEAN8 file is not in the root directory, then you might try using Windows Explorer to search for it on your C: drive until you find it. The Windows name of your file would be: clean8.sas7bdat -- and, the directory location where you find it is the location you'd use in your LIBNAME statement.&lt;BR /&gt;
&lt;BR /&gt;
For more help with this question, you might consider contacting Tech Support or posting to the non-ODS forum since you're now venturing into the world of more general SAS questions like using LIBNAME statements, using macro variables and/or using SQL. &lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 25 Feb 2008 17:02:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7124#M2698</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-02-25T17:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: ODS excel proc print variable format</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7125#M2699</link>
      <description>Thank you for your explanation. It works !</description>
      <pubDate>Mon, 25 Feb 2008 18:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-excel-proc-print-variable-format/m-p/7125#M2699</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2008-02-25T18:33:08Z</dc:date>
    </item>
  </channel>
</rss>

