BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10

Hello,

A dataset has a numeric column with values 0, 1, 2, 3.

I would like to print these numbers with a "€" prefix. so my code is

proc format ; picture Format_Year_Suite low-high = '0' (prefix='€ ') ; run;

proc print data=BEH_INDIC_7 ;

var Suite_Year_4_Sort ;

format Suite_Year_4_Sort Format_Year_Suite. ;

run ;

 

It works for all numbers execpt 0 which is not displayedCapture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
naveenraj
Quartz | Level 8

When you specify zero as the digit selector, any leading zeros in the number to be displayed are shown as blanks

 

proc format ; picture Format_Year_Suite low-high = '9' (prefix='€ ') ; run;

This should work for you 

View solution in original post

4 REPLIES 4
naveenraj
Quartz | Level 8

When you specify zero as the digit selector, any leading zeros in the number to be displayed are shown as blanks

 

proc format ; picture Format_Year_Suite low-high = '9' (prefix='€ ') ; run;

This should work for you 

Nasser_DRMCP
Lapis Lazuli | Level 10

thanks a lot naveenraj. but whenever there are more than 10 years, 10 is diplayed N + 0 (N + 10 intended), 11 is displayed N + 1 (N + 11 intended)...

Nasser_DRMCP
Lapis Lazuli | Level 10

great ! thanks for your quick and reliable response

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 1675 views
  • 1 like
  • 2 in conversation