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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 704 views
  • 0 likes
  • 2 in conversation