BookmarkSubscribeRSS Feed
MuraliK
Calcite | Level 5



48 (SELECT s.shp_trk_nbr as trk_nbr,st.scan_type_acrnm,
49 s.scan_type_cd ||coalesce(s.excp_type_cd, '') as ScanexcpCd,
50 v.svc_commit_tmstp,
51 s.scan_trk_tmstp as scan_tm,
52 opnl_scan_loc_cd as Scan_loc_cd,
53
2 The SAS System 15:39 Thursday, October 25, 2018

54 row_number() over(partition by s.shp_trk_nbr order by s.scan_trk_tmstp desc) as ScantimeRank,
____
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

 

 

Can some one help me to find out which function to use in SAS instead of ROW_NUMBER  OVER PARTITION .

1 REPLY 1
ballardw
Super User

@MuraliK wrote:



48 (SELECT s.shp_trk_nbr as trk_nbr,st.scan_type_acrnm,
49 s.scan_type_cd ||coalesce(s.excp_type_cd, '') as ScanexcpCd,
50 v.svc_commit_tmstp,
51 s.scan_trk_tmstp as scan_tm,
52 opnl_scan_loc_cd as Scan_loc_cd,
53
2 The SAS System 15:39 Thursday, October 25, 2018

54 row_number() over(partition by s.shp_trk_nbr order by s.scan_trk_tmstp desc) as ScantimeRank,
____
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

 

 

Can some one help me to find out which function to use in SAS instead of ROW_NUMBER  OVER PARTITION .


What does ROW_NUMBER  OVER PARTITION do? OVER and PARTITION are also not part of SAS ANSI standard Proc SQL

 

If this is supposed to add some sort of RANK perhaps combine the data you are doing and use PROC RANK to add ranks based on some rules. But would have to know what the rules are.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 940 views
  • 0 likes
  • 2 in conversation