<?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 ROW_NUMBER in FedSQL? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232671#M54736</link>
    <description>&lt;P&gt;Haikuo, thanks for your response. My interpretation is the same as yours, i.e. ROW_NUMBER is a reserved word in FedSQL only means a possibility of future implementation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also thanks for your suggestion, but I guess this ODS approach won't work for ROW_NUMBER by group. I do know other turn around approaches to get ROW_NUMBER by group, just hope there is a staightfoward way of doing this in SAS.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Nov 2015 02:06:43 GMT</pubDate>
    <dc:creator>jflycn</dc:creator>
    <dc:date>2015-11-02T02:06:43Z</dc:date>
    <item>
      <title>How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232584#M54717</link>
      <description>&lt;DIV class="xis-paraTable"&gt;ROW_NUMBER is a reserved word in FedSQL (See:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/p0x0k1rlx0l7e4n1ptngog3ce4jp.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/fedsqlref/67364/HTML/default/p0x0k1rlx0l7e4n1ptngog3ce4jp.htm&lt;/A&gt; ), but I cannot figure out how to use ROW_NUMBER in it. Whatever I tried, I always got "ERROR: Syntax error at or near "ROW_NUMBER"".&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="xis-paraTable"&gt;So how can I use ROW_NUMBER in FedSQL?&lt;/DIV&gt;&lt;DIV class="xis-paraTable"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="xis-paraTable"&gt;Thanks!&lt;/DIV&gt;</description>
      <pubDate>Sat, 31 Oct 2015 20:23:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232584#M54717</guid>
      <dc:creator>jflycn</dc:creator>
      <dc:date>2015-10-31T20:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232605#M54724</link>
      <description>&lt;P&gt;The documentation indicated the use of double quotes while using a reserved word for other purposes. &amp;nbsp; I've tried out in this example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FEDSQL;
DROP TABLE WORK.T1;
create table T1
   ( &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;"ROW_NUMBER"&lt;/FONT&gt;&lt;/STRONG&gt; CHAR(2),
     name char(10),
     state char(2));
DESCRIBE TABLE WORK.T1;
SELECT  * FROM DICTIONARY.COLUMNS WHERE TABLE_NAME = 'T1';
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The results are shown below for your reference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
TABLE_CAT	TABLE_SCHEM	TABLE_NAME	&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;COLUMN_NAME&lt;/STRONG&gt;&lt;/FONT&gt;	DATA_TYPE	TYPE_NAME	COLUMN_SIZE	BUFFER_LENGTH	DECIMAL_DIGITS	NUM_PREC_RADIX	NULLABLE	REMARKS	COLUMN_DEF	TKTS_DATA_TYPE	TKTS_DATETIME_SUB	CHAR_OCTET_LENGTH	ORDINAL_POSITION	IS_NULLABLE
WORK	WORK	T1	&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;ROW_NUMBER&lt;/FONT&gt;&lt;/STRONG&gt;	-8	NCHAR	2	3	.	.	1	 	 	-8	.	2	1	YES
WORK	WORK	T1	NAME	-8	NCHAR	10	11	.	.	1	 	 	-8	.	10	2	YES
WORK	WORK	T1	STATE	-8	NCHAR	2	3	.	.	1	 	 	-8	.	2	3	YES&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The header has shifter a bit but have highlighted in red for ease of reading... Hope this helps.... Good Luck...!!!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2015 02:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232605#M54724</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-01T02:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232607#M54725</link>
      <description>&lt;P&gt;Hi Kannan, thanks for your answer, but I think I did not state my question clear enough. What I meant is to use ROW_NUMBER as it really meant to be, i.e. as a function of retreving row number(e.g. &lt;A href="https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions144.htm" target="_blank"&gt;https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions144.htm&lt;/A&gt; ).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to use ROW_NUMBER to get row number but it did not work.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2015 02:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232607#M54725</guid>
      <dc:creator>jflycn</dc:creator>
      <dc:date>2015-11-01T02:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232609#M54726</link>
      <description>&lt;P&gt;I believe the documentation states that the FEDSQL RESERVED words cannot be used as variable names or in any other way as indicated in the document below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p0x0k1rlx0l7e4n1ptngog3ce4jp.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p0x0k1rlx0l7e4n1ptngog3ce4jp.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The documentation you provided in your URL refers to the ROW_NUMBER feature in ORACLE database. This is one among those nuiances between the two softwares that seems identical but not really so. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p0x0k1rlx0l7e4n1ptngog3ce4jp.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/fedsqlref/67954/HTML/default/viewer.htm#p0x0k1rlx0l7e4n1ptngog3ce4jp.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this clarifies your conundrum.... Good Luck...!!!&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2015 02:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232609#M54726</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-01T02:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232610#M54727</link>
      <description>&lt;P&gt;I can totally understand if SAS FedSQL misses a function which Oracle SQL has. I am just curious since FedSQL already makes ROW_NUMBER&amp;nbsp; a reserved word, I guess there might be a way of using ROW_NUMBER to retrieve row number in FedSQL. Maybe this function is undocumented but usable.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2015 02:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232610#M54727</guid>
      <dc:creator>jflycn</dc:creator>
      <dc:date>2015-11-01T02:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232614#M54729</link>
      <description>&lt;P&gt;It is possible that the reserved word functionality is for its internal use and if a user wants to use the name could use it through double quotes as per the documentation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Nov 2015 03:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232614#M54729</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-11-01T03:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232655#M54735</link>
      <description>&lt;P&gt;I would still consider FeqSQL as an very early implementation (new to 9.4) of &lt;SPAN&gt;ANSI SQL:1999 core standard&lt;/SPAN&gt;, which is the part of 'in-database' prcessing effort along with DS2. Let's hope those reserved key words maybe put in use in the future release. As for the time being, you can still leverage ODS for the same functionality:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ods listing close;
ods output fedsql_results=want;
proc fedsql number;
select * from yourlib.have
;
quit;
ods listing;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Nov 2015 19:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232655#M54735</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-11-01T19:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to use ROW_NUMBER in FedSQL?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232671#M54736</link>
      <description>&lt;P&gt;Haikuo, thanks for your response. My interpretation is the same as yours, i.e. ROW_NUMBER is a reserved word in FedSQL only means a possibility of future implementation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also thanks for your suggestion, but I guess this ODS approach won't work for ROW_NUMBER by group. I do know other turn around approaches to get ROW_NUMBER by group, just hope there is a staightfoward way of doing this in SAS.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 02:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-use-ROW-NUMBER-in-FedSQL/m-p/232671#M54736</guid>
      <dc:creator>jflycn</dc:creator>
      <dc:date>2015-11-02T02:06:43Z</dc:date>
    </item>
  </channel>
</rss>

