BookmarkSubscribeRSS Feed
Bill
Quartz | Level 8
I'm reading data from an xl file and then run it through the data step below in preparation for the proc format that follows it. Works the way it should.
The data that I apply this format to has values that are not in the start list. I'd like to group these into a category called 'Other'. I can add a label = 'Other' but I don't know how to 'wildcard' the start value. If you can help, please do. Thanks.

data CPL4DelCd;
set _4CPLDELAYCODES ;
fmtname='$CPL4Dly';
Label=AMDelayCd1||AMDelayCd2;
Start=Dly_Class_Cd||Dly_Type_Cd||Dly_Reason_Cd;

run;


proc format cntlin=CPL4DelCd;
run;
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A Google advanced search of the SAS support http://support.sas.com/ website yielded several matches, some SAS-hosted documentation and some technical papers on the topic. Here's the search argument - the site: parameter limits the search:

proc format cntlin other site:sas.com

Another discovery technique would be to create a simple format with PROC FORMAT and VALUE, coding an OTHER= , and then run PROC FORMAT with CNTLOUT= and use PROC PRINT to see the SAS-generated results.

You will want to explore using the HLO='O' variable value, leaving START as blank, and assigning some desired LABEL variable value -- this would be an extra observation.


Scott Barry
SBBWorks, Inc.
Bill
Quartz | Level 8
Thanks Scott. The HLO option does the trick. Shown below.

data CPL4DelCd end=last;
set _4CPLDELAYCODES ;
fmtname='$CPL4Dly';
Label=AMDelayCd1||AMDelayCd2;
Start=Dly_Class_Cd||Dly_Type_Cd||Dly_Reason_Cd;
output;

if last then do;
hlo='O'; /* upper case letter O */
label='Othr';
output;
end;

run; edit by Bill 14May2009 14:19 EDT

Message was edited by: Bill

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