<?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: Proc Sql: Creating New Table with Format in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534845#M7038</link>
    <description>&lt;P&gt;Oh my goodness, such a silly mistake. Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 14:03:54 GMT</pubDate>
    <dc:creator>talzy7</dc:creator>
    <dc:date>2019-02-12T14:03:54Z</dc:date>
    <item>
      <title>Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534813#M7027</link>
      <description>&lt;P&gt;I have succesfully created a table using a query in proc sql. The issue I am having is when I try and give my variables in my select statement a format (i.e. select salary format = comma10.2) the format is not being recognized. Any ideas as to why my format is being ignored?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534813#M7027</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T13:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534816#M7028</link>
      <description>&lt;P&gt;Show us the LOG of the entire PROC SQL. Click on the {i} icon and paste the code into the window that appears — DO NOT SKIP THIS STEP.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you say the format is being ignored? What do you see that indicates the format is being ignored? Show us.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534816#M7028</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-12T13:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534820#M7029</link>
      <description>&lt;PRE&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 70         
 71         
 72         libname  orion "/courses/d0f434e5ba27fe300/sql" access=readonly;
 NOTE: Libref ORION refers to the same physical library as _TEMP5.
 NOTE: Libref ORION was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /courses/d0f434e5ba27fe300/sql
 73         
 74         proc sql;
 75         create table work.Direct_Compensation as
 76         select distinct o.Employee_ID, catx('',First_Name, Last_Name) as Name, substr(Job_Title,12,3) as level, Salary informat =
 76       !  comma8.2 format = comma8.2, sum(Total_Retail_Price)*0.15 as commission  format = comma8.2, calculated commission +
 76       ! salary as Direct_Compensation  format = comma8.2
 77         from orion.Order_Fact as o , orion.Sales as s
 78         where o.Employee_ID=s.Employee_ID and year(Order_Date)=2007 and Job_Title not contains 'Manager'
 79         group by o.Employee_ID
 80         ;
 NOTE: The query requires remerging summary statistics back with the original data.
 NOTE: Table WORK.DIRECT_COMPENSATION created, with 44 rows and 6 columns.
 
 81         
 82         select *
 83         from work.Direct_Compensation
 84         ;
 85         quit;
 NOTE: PROCEDURE SQL used (Total process time):
       real time           0.07 seconds
       user cpu time       0.07 seconds
       system cpu time     0.00 seconds
       memory              20660.89k
       OS Memory           50108.00k
       Timestamp           02/12/2019 01:07:35 PM
       Step Count                        304  Switch Count  3
       Page Faults                       0
       Page Reclaims                     779
       Page Swaps                        0
       Voluntary Context Switches        25
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           288
       
 
 86         
 87         
 88         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 100 &lt;/PRE&gt;&lt;P&gt;Above is the log file. When adding a query to list the data in the table the format is not present in the output.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534820#M7029</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T13:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534821#M7030</link>
      <description>&lt;P&gt;I don't think you can apply format to a variable which already exists.&amp;nbsp; Have you tried:&lt;/P&gt;
&lt;PRE&gt;select  oldvar as newvar length=20 format=$20 label="Some label"&lt;/PRE&gt;
&lt;P&gt;So oldvar is what comes in, newvar would be name of variable going out.&amp;nbsp; Can be the same name, but needs to have the &amp;lt;var&amp;gt; as &amp;lt;var&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534821#M7030</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-12T13:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534824#M7031</link>
      <description>&lt;P&gt;I have tried this within the create table environment and it doesn't seem to work. If this were the case wouldn't the variable commission appear formatted?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534824#M7031</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T13:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534825#M7032</link>
      <description>&lt;P&gt;You didn't answer this question that I asked earlier.&amp;nbsp;You can't say "it doesn't seem to work" without explaining.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Why do you say the format is being ignored? What do you see that indicates the format is being ignored? Show us.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534825#M7032</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-12T13:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534827#M7033</link>
      <description>&lt;P&gt;When I create a query to list the data in the table, the variables i formatted in the table do not appear formatted in the output.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534827#M7033</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T13:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534831#M7034</link>
      <description>&lt;P&gt;Show us&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, why do you need a query, what about PROC PRINT? Or Viewtable?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534831#M7034</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-12T13:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534832#M7035</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;When I create a query to list the data in the table" - do you mean the lst output from proc sql?&amp;nbsp; Use proc report (or other reporting function) to output the data to a particular file format.&amp;nbsp; List output is just old plain text dump so doesn't have anything fancy.&amp;nbsp; I mean you could put() numeric into a format rather than applying a format, but why, if you want to look at the data in a nice format use the appropriate procedures.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534832#M7035</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-12T13:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534836#M7036</link>
      <description>&lt;P&gt;Unfortunately, it is a requirement in my assignment. The output is below. As you can see the comma10.2 format is not being recognized for the variables Salary, Commission, and Direct_Compensation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results.png" style="width: 461px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27084i6EA4493DD143EA92/image-size/large?v=v2&amp;amp;px=999" role="button" title="results.png" alt="results.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:49:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534836#M7036</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T13:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534839#M7037</link>
      <description>&lt;P&gt;Your code shows comma8.2 (not 10.2)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format is not wide enough to put commas, all the digits (there are 7 of them) and a decimal point. You can't fit all of that into a width of 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comma10.2 probably would work, comma12.2 would definitely work.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 13:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534839#M7037</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-12T13:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql: Creating New Table with Format</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534845#M7038</link>
      <description>&lt;P&gt;Oh my goodness, such a silly mistake. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 14:03:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Proc-Sql-Creating-New-Table-with-Format/m-p/534845#M7038</guid>
      <dc:creator>talzy7</dc:creator>
      <dc:date>2019-02-12T14:03:54Z</dc:date>
    </item>
  </channel>
</rss>

