BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello dears sas users
in france it's sad because we went back to home in football...

data allez_france;
format un $20.;
un="on est nuls";
output;
un="domenech demission";
output;
run;

if i want to create an counter of lines with a data step i can do
data count;
set allez_france;
i=_n_;
run;

i just want to know the equivalent code in proc sql please
thank you
4 REPLIES 4
deleted_user
Not applicable
You can get the row number using monotonic() function within proc sql.
Cynthia_sas
SAS Super FREQ
Hi:
For simple queries, monotonic() may work. However, see this Tech Support note:
http://support.sas.com/kb/15/138.html
which says:
"Using the MONOTONIC() function in PROC SQL can cause missing or non-sequential values to be returned."


You may want to check with Tech Support or switch to using PROC PRINT's obs numbers or use a DATA step program to create an obs number variable.

cynthia
deleted_user
Not applicable
Thank you, Cynthia.
deleted_user
Not applicable
Thank you cynthia and vasile

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 736 views
  • 0 likes
  • 2 in conversation