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