DATA Step, Macro, Functions and more

proc format picture does not display number 0

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 111
Accepted Solution

proc format picture does not display number 0

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


Accepted Solutions
Solution
‎08-17-2017 08:04 AM
Contributor
Posts: 54

Re: proc format picture does not display number 0

Posted in reply to Nasser_alfea

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


All Replies
Solution
‎08-17-2017 08:04 AM
Contributor
Posts: 54

Re: proc format picture does not display number 0

Posted in reply to Nasser_alfea

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 

Frequent Contributor
Posts: 111

Re: proc format picture does not display number 0

Posted in reply to naveenraj

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)...

Contributor
Posts: 54

Re: proc format picture does not display number 0

Posted in reply to Nasser_alfea

http://www2.sas.com/proceedings/sugi31/243-31.pdf 

 

please refer page 7 of this document.

Frequent Contributor
Posts: 111

Re: proc format picture does not display number 0

Posted in reply to naveenraj

great ! thanks for your quick and reliable response

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 162 views
  • 1 like
  • 2 in conversation