<?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: Facing problem while sorting. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49729#M13504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'n is used for what purpose?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Mar 2012 11:11:26 GMT</pubDate>
    <dc:creator>manojinpec</dc:creator>
    <dc:date>2012-03-30T11:11:26Z</dc:date>
    <item>
      <title>Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49725#M13500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam having bellow code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=test;&lt;/P&gt;&lt;P&gt;by 'emp id'n 'emp target'n;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;by 'emp id'n 'emp target'n;&lt;/P&gt;&lt;P&gt;if first.'emp id'n ne 1 then 'emp taget'n=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i run the code i am not getting the correct output.&lt;/P&gt;&lt;P&gt;i mean to say first. last. variables are not creating...&lt;/P&gt;&lt;P&gt;Some one saying it is because of variables...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please clarify me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 08:31:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49725#M13500</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2012-03-30T08:31:03Z</dc:date>
    </item>
    <item>
      <title>Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49726#M13501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; First and last variables are hidden automatic variables. they will not be visible.If you want to view them assgin it to some difference variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=test;&lt;/P&gt;&lt;P&gt;by 'emp id'n 'emp target'n;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test1;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;by 'emp id'n 'emp target'n;&lt;/P&gt;&lt;P&gt;a=first.emp_id;&lt;/P&gt;&lt;P&gt;b=last.emp_id;&lt;/P&gt;&lt;P&gt;c=first.emp_target;&lt;/P&gt;&lt;P&gt;d-last.emp_target;&lt;/P&gt;&lt;P&gt;if first.'emp id'n ne 1 then 'emp taget'n=0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 08:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49726#M13501</guid>
      <dc:creator>manojinpec</dc:creator>
      <dc:date>2012-03-30T08:33:54Z</dc:date>
    </item>
    <item>
      <title>Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49727#M13502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first. last. variables have already created by SAS.&lt;/P&gt;&lt;P&gt;But because they are temporary variables, they will not appear at PDV ,but at somewhere at memory.&lt;/P&gt;&lt;P&gt;And they will not output dataset defaultly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 08:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49727#M13502</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-30T08:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49728#M13503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry to all.&lt;/P&gt;&lt;P&gt;A small typo error happened in my above post.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am not getting correct output.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;there i am using&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;if first.'emp id'n ne 1 then 'emp taget'n=0&amp;nbsp; condition.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this condition was not working because the variable names that i mentioned as 'emp id'n and 'emp taregt'n.&lt;/P&gt;&lt;P&gt;if I change variable names to emp_id and emp_target, the condition was working....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So&amp;nbsp; what's wrong with variable names?????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 09:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49728#M13503</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2012-03-30T09:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49729#M13504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;'n is used for what purpose?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 11:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49729#M13504</guid>
      <dc:creator>manojinpec</dc:creator>
      <dc:date>2012-03-30T11:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49730#M13505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to define&amp;nbsp; variable name with "space", generally we use n.&lt;/P&gt;&lt;P&gt;for example if you&amp;nbsp; want to create a variable with name "customer name",SAS won't accept this name directly because there is a space between customer and name..&lt;/P&gt;&lt;P&gt;For this you need to specify like this 'customer name'n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if any clarification needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Sanjeev.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 11:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49730#M13505</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2012-03-30T11:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49731#M13506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Is it applicable for SAS 8.2 . I am using sas 8.2 and i am not able to assign this name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 11:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49731#M13506</guid>
      <dc:creator>manojinpec</dc:creator>
      <dc:date>2012-03-30T11:23:28Z</dc:date>
    </item>
    <item>
      <title>Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49732#M13507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think it works in 8.2.&lt;/P&gt;&lt;P&gt;this is the&amp;nbsp; new option which I found in SAS recently .&lt;/P&gt;&lt;P&gt;it is working in 9.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 11:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49732#M13507</guid>
      <dc:creator>kuridisanjeev</dc:creator>
      <dc:date>2012-03-30T11:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Facing problem while sorting.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49733#M13508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to set validvarname=any.&amp;nbsp; But you are probably better off NOT using it.&amp;nbsp; You can use the variable label instead to store the description of the variable.&amp;nbsp; Most procs will list the label along with the variable name.&amp;nbsp; You can use the LABEL option for PROC PRINT to have the column headers be the label instead of the name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data x;
2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'This name'n=100;
&lt;STRONG&gt;ERROR: The name This name is not a valid SAS name.&lt;/STRONG&gt;
3&amp;nbsp;&amp;nbsp;&amp;nbsp; run;

NOTE: The SAS System stopped processing this step because of errors.
&lt;STRONG&gt;WARNING: The data set WORK.X may be incomplete.&amp;nbsp; When this step was stopped there were 0 observations and 0 variables.&lt;/STRONG&gt;

4&amp;nbsp;&amp;nbsp;&amp;nbsp; options validvarname=any;
&lt;STRONG&gt;WARNING: Only the Base product and the SAS/STAT product have been tested for use with VALIDVARNAME=ANY. Other use of this option is considered
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; experimental and may cause undetected errors.
&lt;/STRONG&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data x;
6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'This name'n=100;
7&amp;nbsp;&amp;nbsp;&amp;nbsp; run;

NOTE: The data set WORK.X has 1 observations and 1 variables.
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 12:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Facing-problem-while-sorting/m-p/49733#M13508</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-03-30T12:37:34Z</dc:date>
    </item>
  </channel>
</rss>

