The SAS Output Delivery System and reporting techniques

question about reporting formatted andf unformatted values in same report

Reply
Contributor
Posts: 53

question about reporting formatted andf unformatted values in same report

Hi, I have a reporting requirement to print BOTH the formatted and unformatted values side by side in a report.

For example:

Gender FEMALE 2

Is there a straightforward way to accomplish this? TIA.
Super Contributor
Super Contributor
Posts: 3,174

Re: question about reporting formatted andf unformatted values in same report

The answer will depend on how you expect to generate the report, that being with PROC PRINT, PROC REPORT, PROC SQL (or another procedure) or a DATA step?

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 53

Re: question about reporting formatted andf unformatted values in same report

Most likely REPORT or PRINT.
SAS Super FREQ
Posts: 8,743

Re: question about reporting formatted andf unformatted values in same report

Hi:
PROC REPORT would probably be your best bet. You can use a variable to create a second report item with an "alias" for referencing on the report:
[pre]
column name gender gender=ugend age;
[/pre]

and then in your DEFINE statements, you can have:
[pre]
define gender / display f=gfmt. 'Formatted value';
define ugend / display 'Unformatted';
[/pre]

This is a neat feature of PROC REPORT because the format is applied on the DEFINE statement instead of in a FORMAT statement. In this example, the variable GENDER is used once on the report with a format and then the alias, UGEND, is GENDER used a second time on the report, but WITHOUT a format.

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 140 views
  • 0 likes
  • 3 in conversation