BookmarkSubscribeRSS Feed
kishore415
Calcite | Level 5

Hi All,

   Is there any option in proc print to print the serial number instead of observation number..?

for example : proc print with obs option is resulting in below output..

          Obs    Name       Sex    Age    Height    Weight

             1    Alfred      M      14     69.0      112.5

             5    Henry       M      14     63.5      102.5

             6    James       M      12     57.3       83.0

             9    Jeffrey     M      13     62.5       84.0

but I want it to print

               Obs    Name       Sex    Age    Height    Weight

             1    Alfred      M      14     69.0      112.5

             2   Henry       M      14     63.5      102.5

             3   James       M      12     57.3       83.0

             4    Jeffrey     M      13     62.5       84.0

Thanks in advance..

3 REPLIES 3
polingjw
Quartz | Level 8

Will this work?

data class /view=class;

      set sashelp.class;

run;

proc print data=class;

      where name in ('Alfred' 'Henry' 'James' 'Jeffrey');

run;

manojinpec
Obsidian | Level 7

Can create a Variable sno=_n_ and then print the report with noobs option.

Ksharp
Super User

As far as I know there is not such a option. You need to make a variable to display this information.

Ksharp

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
  • 3 replies
  • 1023 views
  • 0 likes
  • 4 in conversation