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


I have the following formats in a format library:

value $Credit_Grp

     '1' = '0-15'

     '2' = '16-30'

     '3' = '31+';


value $Credit_Grp2

     '1' = '0-15 Credit Hours'

     '2' = '16-30 Credit Hours'

     '3' = '31+ Credit Hours';

When I run the tabulate code below using the $Credit_Grp format it works as advertised. But when I use the $Credit_Grp2 format it only displays the first two characters (ie "0-", "16", "31") for each value. What am I doing wrong? Thanks.

tabulate data = AnnFiveYearCombined2;

     class ay2 acadplan Credit_Grp;

     var FTES;

     format acadplan $acadplandeg.;

     format Credit_Grp $Credit_Grp.;

     table Credit_Grp='Credit Hours' all='Total'*f=comma6., ay2=''*(N='HC' FTES='FTES'*sum=''*f=comma6.);

run;

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

Format names are not allowed to end in a number since this number is taken as the length of the formatted value call your format $Credit_Grp2X and it should work

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

Hi

Format names are not allowed to end in a number since this number is taken as the length of the formatted value call your format $Credit_Grp2X and it should work

BTAinRVA
Quartz | Level 8

Thanks Bruno. I'm a newbie when it comes to format libraries.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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