BookmarkSubscribeRSS Feed
ieva
Pyrite | Level 9
Hi,

I know that there is such a MERGENOBY option. Is there also something similar that would work something like SET NO BY but, for example, just in cases if you use FIRST.variable or LAST.variable? (Option that would not let you use first.variable if you don't use BY statement?)

Seems too complicated to really have such, but maybe you know some trick how not to forget BY statement in such cases 🙂

Thanks,
Ieva
3 REPLIES 3
Peter_C
Rhodochrosite | Level 12
no options seem to support this (although I think there is a SAS92 feature which would convert a lot of NOTE messages into ERROR or WARNING).
If you want a quick check, search for strings
"NOTE: Variable first." and "NOTE: Variable last."
could be worth a ballot item http://support.sas.com/community/ballot/ or "Suggestion" at http://support.sas.com/contact/software_comments.html

peterC
data_null__
Jade | Level 19
The undocumented DSOPTIONS may be useful.

[pre]
120 options dsoptions=note2err;
121 data test;
122 set sashelp.class;
123 if first.name then;
124 run;

ERROR: Variable first.name is uninitialized.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0
observations and 5 variables.
WARNING: Data set WORK.TEST was not replaced because this step was stopped
[/pre]
ieva
Pyrite | Level 9
Great thanks Peter and data _null_! That is the option I was searching for.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1762 views
  • 0 likes
  • 3 in conversation