BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

I'd like to convert this program to a cas action like freqtab. Can I use the _numeric_ shortcut in an cas action?

Have:

proc format;
value $ missfmt ' '="Missing" other="Not Missing";
value nmissfmt .="Missing" other="Not Missing";
run;
*Proc freq to count missing/non missing;
options casdatalimit=all;
ods table onewayfreqs=temp;
proc freq data=MKT.PROFILE_PORTFOLIO;
table _all_ / missing;
format _numeric_ nmissfmt. _character_ $missfmt.;
run;

Want: 

proc cas;
   action freqTab.freqTab /
      table={name='PROFILE_PORTFOLIO', caslib="mkt", 
....
1 ACCEPTED SOLUTION

Accepted Solutions
JOL
SAS Employee JOL
SAS Employee

No, it does not appear possible to use special name lists and the documentation does not seem to support it. 

Some tips:

Add user-defined formats to CAS with the CASFMTLIB option:

proc format CASFMTLIB = "CASFORMATS";
value $ missfmt ' '="Missing" other="Not Missing";
value nmissfmt .="Missing" other="Not Missing";
run;

   

 

Apply formats with the ALTERTABLE action:

proc cas;
table.altertable / columns{{name = "Var1", format = "$missfmt."
                            {name = "Var2", format = "nmissfmt."}},
      name='PROFILE_PORTFOLIO';
action freqTab.freqTab /
    table={name='PROFILE_PORTFOLIO', caslib="mkt", ...

 

 

Documentation:

Manage Your User-Defined Formats

Applying Labels and Formats

 

 

 

 

 

 

View solution in original post

1 REPLY 1
JOL
SAS Employee JOL
SAS Employee

No, it does not appear possible to use special name lists and the documentation does not seem to support it. 

Some tips:

Add user-defined formats to CAS with the CASFMTLIB option:

proc format CASFMTLIB = "CASFORMATS";
value $ missfmt ' '="Missing" other="Not Missing";
value nmissfmt .="Missing" other="Not Missing";
run;

   

 

Apply formats with the ALTERTABLE action:

proc cas;
table.altertable / columns{{name = "Var1", format = "$missfmt."
                            {name = "Var2", format = "nmissfmt."}},
      name='PROFILE_PORTFOLIO';
action freqTab.freqTab /
    table={name='PROFILE_PORTFOLIO', caslib="mkt", ...

 

 

Documentation:

Manage Your User-Defined Formats

Applying Labels and Formats

 

 

 

 

 

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 521 views
  • 0 likes
  • 2 in conversation