BookmarkSubscribeRSS Feed
aabbccwyt
Obsidian | Level 7

Hi,

The assignment I'm working asks me to use proc univariate to explore the 8 extreme observations in a worksheet, so I used the SAS Documentation and it says to use 

nextrobs=8;

which gives me an error: ERROR 180-322: Statement is not valid or it is used out of proper order.

Can anyone tell me how to fix it? Thank you.

6 REPLIES 6
mintbit
Obsidian | Level 7
i have a question relating to this. The nextrob option is not in parentheses but the (obs=n) is. are they not both options? How do I know when to put something in parentheses?
Tom
Super User Tom
Super User

@mintbit wrote:
i have a question relating to this. The nextrob option is not in parentheses but the (obs=n) is. are they not both options? How do I know when to put something in parentheses?

OBS= is a Dataset Option.  Like KEEP= or RENAME=. Those always appear in parentheses after a dataset name.  They are totally independent of PROC UNIVARIATE.  You can use dataset options pretty much anywhere you use a dataset name.

 

NEXTROB is an optional part the PROC UNIVARIATE statement.

mintbit
Obsidian | Level 7
Thank you for the reply Tom. Now I understand better.
Qingwei
Calcite | Level 5

use codes like below:

ods select extremeobs;
proc univariate data=pg1.eu_occ nextrobs=10;
var camp;
run;
ods trace off;

coder1234
Obsidian | Level 7
ODS select  ExtremeObs;

proc univariate data=data.lib
	nextrobs=8;
	Var abc def;
Run;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 7119 views
  • 4 likes
  • 6 in conversation