How to Obtain **OTHER** Format values ???

Reply
Contributor
Posts: 46

How to Obtain **OTHER** Format values ???

How to Obtain **OTHER** Format values ???

Consider the below code


proc format;
value first
2='Two'
3='Three';

value final
1='One'
other=[first.];
run;


proc format library=work cntlout=formats;
run;


Dataset content from format dataset.

Expected Output:
FMTNAME  START   LABEL
FINAL            1        One
FINAL            2        Two
FINAL            3        Three

Actual Output
FMTNAME  START   LABEL
FINAL            1             One
FINAL    **OTHER**      FIRST40.

Many Thanks...


Capture.PNG
Regular Contributor
Posts: 151

Re: How to Obtain **OTHER** Format values ???

Posted in reply to suraestar

Your FINAL format says to display 1 as 'One', with any other value displayed using the FIRST. format.  This means that 2 and 3 will be formatted as 'Two' and 'Three', whereas other numbers will be displayed as they are stored, due to not being included in the FIRST format.  The OTHER statement covers all other values, not just those included in the FIRST format, therefore your cntlout output is correct

Contributor
Posts: 46

Re: How to Obtain **OTHER** Format values ???

Yes, my output is correct. but i need the expected output.. Since i will be using some process based on that dataset..

Regular Contributor
Posts: 151

Re: How to Obtain **OTHER** Format values ???

Posted in reply to suraestar

You either need to detail the specific values in the format statement (2,3 = [first.])

or use the FIRST format values as well as those from FINAL in the cntlout output.

Contributor
Posts: 46

Re: How to Obtain **OTHER** Format values ???

Thanks Keith...

Ask a Question
Discussion stats
  • 4 replies
  • 205 views
  • 0 likes
  • 2 in conversation