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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1474 views
  • 0 likes
  • 2 in conversation