BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Davanden
Obsidian | Level 7

Is there a complete list of SAS procedures that support multilabel formats?  Today I'm interested in SURVEYMEANS, but tomorrow it could be another one.

1 ACCEPTED SOLUTION

Accepted Solutions
Norman21
Lapis Lazuli | Level 10

"Multilabel formats are available for use only in the MEANS, SUMMARY, TABULATE, and REPORT procedures. "

 

https://blogs.sas.com/content/sgf/2016/12/16/creating-and-using-multilabel-formats/

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

View solution in original post

4 REPLIES 4
Norman21
Lapis Lazuli | Level 10

"Multilabel formats are available for use only in the MEANS, SUMMARY, TABULATE, and REPORT procedures. "

 

https://blogs.sas.com/content/sgf/2016/12/16/creating-and-using-multilabel-formats/

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

data_null__
Jade | Level 19

You can use a procedure like PROC SUMMARY to expand your data using a MLF and output a data set used as input to another procedure.

 

/*Expand data using MULTILABEL formats*/
proc format;
   value $sex(multilabel notsorted)
      'M'     = 'Male'
      'F'     = 'Female'
      'X'     = 'Unk'
      'M','F' = 'Both'
      'X','F','M' = 'Total'
      ;
   quit;
data class;
   _obs_ + 1;
   set sashelp.class(keep=sex);
   if _n_ eq 5 then sex='X';
   retain _sentinal1 ' ';
   set sashelp.class(drop=sex);
   retain _sentinal2 ' ';
   run;
proc print;
   run;
proc summary data=class nway completetypes missing;
   by _obs_;
   class sex / order=data mlf preloadfmt;
   format sex $Sex.;
   output out=expand(drop=_type_ _SENT: where=(_freq_ gt 0)) idgroup(out(_sentinal1--_sentinal2)=) / levels;
   run;
proc print;
   run;

Capture.PNG

 

ballardw
Super User

I think that you might try creating CLASS or DOMAIN variables for each level of your multilabel format for use with Survey procs. This is likely to involve sending the output to datasets and filtering/merging data sets to get desired result.

 

Davanden
Obsidian | Level 7

Yes, I can do that.  I was hoping to avoid that extra step.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 1005 views
  • 2 likes
  • 4 in conversation