<?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: How to use variables with a period/dot stop in their name? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327406#M73031</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Crikey, not seen this before. &amp;nbsp;A SAS procedure creating a dataset with non-SAS compliant variable names? &amp;nbsp;Anyways, when I run that on my machine the variable names use underscore rather than a dot:&lt;/P&gt;
&lt;P&gt;P_05&lt;/P&gt;
&lt;P&gt;For example. &amp;nbsp;All I can think of is that you have some options set -&lt;/P&gt;
&lt;P&gt;options validavarname=any;&lt;/P&gt;
&lt;P&gt;For instance allows anything, non-standard SAS names included. &amp;nbsp;I would avoid using that, and get varnames in a proper compliant manner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should however be able to reference them using named literals:&lt;/P&gt;
&lt;P&gt;'P.05'n&lt;/P&gt;
&lt;P&gt;However, as above I really recommend not doing this. &amp;nbsp;Try to change your system options to only allow standard SAS naming.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no mistery here&amp;nbsp;your machine has different defaults.&lt;/P&gt;
&lt;P&gt;options validvarname=V7;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2017 15:25:22 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2017-01-25T15:25:22Z</dc:date>
    <item>
      <title>How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327394#M73025</link>
      <description>&lt;P&gt;&amp;nbsp;am using a SAS procedure that produces an ods output dataset that contains variables that have a period (dot) in their name (example p0.5. A minimum example for reproducing this behavior in SAS 9.4 TS Level 1M1 running on AIX is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to do something with these variables later in a datastep, let's say assigning it's value to another variable. But when I use a variable name such as p0.5, I get a "ERROR 386-185: Expecting an arithmetic expression. ERROR 201-322: The option is not recognized and will be ignored." error message, which I interpret as SAS not understanding that I wish to refer to the variable (and instead trying to interpret this as some kind of arithmetic expression). I tried things like p05 or p0_5, but these result in "Variable p05 is uninitialized."&amp;nbsp;I could not find any information about this situation (but perhaps I have just not used for the right information search terms).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas on how to do anything with this variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  y=1; se=10;output;
  y=2; se=10;output;
  y=1.5; se=10;output;
run;

ods output PostSummaries=PostSummaries PostIntervals=PostIntervals;
proc mcmc data=test statistics(PERCENT=(0.025 0.5 0.975))=(SUMMARY INTERVAL);
  parms mu 1.5;   
  prior mu ~ normal(0, sd=10);
  model y ~ normal(mu,sd=se);   
run;

data posterior;
  merge PostSummaries(where=(parameter="mu")) PostIntervals(where=(parameter="mu"));
  by parameter;
run;

proc contents;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the output of the proc contents:&lt;/P&gt;
&lt;PRE&gt;The CONTENTS Procedure                                                 
                                                                                                                        
             Data Set Name        WORK.POSTERIOR                                   Observations          1              
             Member Type          DATA                                             Variables             12             
             Engine               V9                                               Indexes               0              
             Created              01/25/2017 15:46:35                              Observation Length    96             
             Last Modified        01/25/2017 15:46:35                              Deleted Observations  0              
             Protection                                                            Compressed            NO             
             Data Set Type                                                         Sorted                NO             
             Label                                                                                                      
             Data Representation  HP_UX_64, RS_6000_AIX_64, SOLARIS_64, HP_IA64                                         
             Encoding             latin1  Western (ISO)                                                                 
                                                                                                                        
                                                                                                                        
                                           Engine/Host Dependent Information                                            
                                                                                                                        
          Data Set Page Size          65536                                                                             
          Number of Data Set Pages    1                                                                                 
          First Data Page             1                                                                                 
          Max Obs per Page            681                                                                               
          Obs in First Data Page      1                                                                                 
          Number of Data Set Repairs  0                                                                                 
          Filename                    /proj/sastmp/saswork/SAS_work432E00A802D4_chbsux0577/posterior.sas7bdat           
          Release Created             9.0401M1                                                                          
          Host Created                AIX                                                                               
          Inode Number                454799                                                                            
          Access Permission           rw-rw-rw-                                                                         
          Owner Name                  xxxxxxx                                                                          
          File Size (bytes)           131072                                                                            
                                                                                                                        
                                                                                                                        
                                       Alphabetic List of Variables and Attributes                                      
                                                                                                                        
                            #    Variable         Type    Len    Format    Label                                        
                                                                                                                        
                            8    Alpha            Num       8    D5.                                                    
                            9    CredibleLower    Num       8    D8.                                                    
                           10    CredibleUpper    Num       8    D8.                                                    
                           11    HPDLower         Num       8    D8.                                                    
                           12    HPDUpper         Num       8    D8.                                                    
                            3    Mean             Num       8    D8.                                                    
                            2    N                Num       8    8.                                                     
                            6    P0.5             Num       8    D8.       0.5                                          
                            5    P0.025           Num       8    D8.       0.025                                        
                            7    P0.975           Num       8    D8.       0.975                                        
                            1    Parameter        Char      2                                                           
                            4    StdDev           Num       8    D8.       Standard Deviation                           &lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jan 2017 14:59:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327394#M73025</guid>
      <dc:creator>BjoernHolzhauer</dc:creator>
      <dc:date>2017-01-25T14:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327397#M73026</link>
      <description>&lt;P&gt;'p0.5'n&amp;nbsp; the quotes are needed because when special characters are allowed in variable names they might include spaces and the quotes indicate the whole name the trailing n tells SAS to use the string as a variable name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though my preference would be fix the process that is generating the names to use typical SAS names unless those variables are in an external database.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327397#M73026</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-25T15:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327399#M73028</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Crikey, not seen this before. &amp;nbsp;A SAS procedure creating a dataset with non-SAS compliant variable names? &amp;nbsp;Anyways, when I run that on my machine the variable names use underscore rather than a dot:&lt;/P&gt;
&lt;P&gt;P_05&lt;/P&gt;
&lt;P&gt;For example. &amp;nbsp;All I can think of is that you have some options set -&lt;/P&gt;
&lt;P&gt;options validavarname=any;&lt;/P&gt;
&lt;P&gt;For instance allows anything, non-standard SAS names included. &amp;nbsp;I would avoid using that, and get varnames in a proper compliant manner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should however be able to reference them using named literals:&lt;/P&gt;
&lt;P&gt;'P.05'n&lt;/P&gt;
&lt;P&gt;However, as above I really recommend not doing this. &amp;nbsp;Try to change your system options to only allow standard SAS naming.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327399#M73028</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-25T15:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327402#M73029</link>
      <description>&lt;P&gt;Thanks, the 'p0.5'n approach solved the problem. I actually tried to convince SAS not to do this, but options validvarname=v6 did not avoid it...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:22:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327402#M73029</guid>
      <dc:creator>BjoernHolzhauer</dc:creator>
      <dc:date>2017-01-25T15:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327403#M73030</link>
      <description>Thanks! The 'p0.5'n approach solved the problem. I actually tried to convince SAS not to do this, but options validvarname=v6 did not avoid it. Beyond that, I cannot easily change settings in our system, but I will let people know.&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327403#M73030</guid>
      <dc:creator>BjoernHolzhauer</dc:creator>
      <dc:date>2017-01-25T15:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use variables with a period/dot stop in their name?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327406#M73031</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Crikey, not seen this before. &amp;nbsp;A SAS procedure creating a dataset with non-SAS compliant variable names? &amp;nbsp;Anyways, when I run that on my machine the variable names use underscore rather than a dot:&lt;/P&gt;
&lt;P&gt;P_05&lt;/P&gt;
&lt;P&gt;For example. &amp;nbsp;All I can think of is that you have some options set -&lt;/P&gt;
&lt;P&gt;options validavarname=any;&lt;/P&gt;
&lt;P&gt;For instance allows anything, non-standard SAS names included. &amp;nbsp;I would avoid using that, and get varnames in a proper compliant manner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should however be able to reference them using named literals:&lt;/P&gt;
&lt;P&gt;'P.05'n&lt;/P&gt;
&lt;P&gt;However, as above I really recommend not doing this. &amp;nbsp;Try to change your system options to only allow standard SAS naming.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no mistery here&amp;nbsp;your machine has different defaults.&lt;/P&gt;
&lt;P&gt;options validvarname=V7;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 15:25:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-use-variables-with-a-period-dot-stop-in-their-name/m-p/327406#M73031</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2017-01-25T15:25:22Z</dc:date>
    </item>
  </channel>
</rss>

