LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 27 Jun 2007 17:09:45 +0000
Reply-To:   iw1junk@COMCAST.NET
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ian Whitlock <iw1junk@COMCAST.NET>
Subject:   Re: Freq-ing with ODS
Comments:   cc: JeffreyT.Talbot@GMAIL.COM

Summary: Bug in long format names. #iw-value=1

Jeffery,

You would find more help faster if you make it easy for one to do. For example,

proc format ; VALUE MORTALF 0='0 ALIVE' 1='1 DEATH' ; VALUE TYPEDEATHF 0='0 NO DEATH' 1='1 CANCER DEATH' 2='2 CARDIO D' 3='3 DIABET D' 4='4 OTHER D' ; run ;

data w ; format mortal mortalf. typedeath typedeathf. ; do obs = 1 to 100 ; mortal = round(ranuni(569023)) ; typedeath = round(4 * ranuni(0)) ; output ; end ; run ;

TITLE "MORTALITY BY typedeath"; ODS OUTPUT CrossTabFreqs=cross (KEEP =MORTAL typedeath FREQUENCY) ; PROC FREQ DATA=w order=INTERNAL; TABLES typedeath*MORTAL; RUN; ods output close ;

Armed with the above example, I changed the name TYPEDEATHF to meet the old standard 8 byte limit and both formats were displayed. Apparently ODS OUTPUT does not know how to handle long format names.

Ian Whitlock ==================== Date: Wed, 27 Jun 2007 14:36:22 -0000 Reply-To: JeffreyT.Talbot@GMAIL.COM Sender: "SAS(r) Discussion" From: JeffreyT.Talbot@GMAIL.COM Organization: http://groups.google.com Subject: Freq-ing with ODS Comments: To: sas-l Content-Type: text/plain; charset="iso-8859-1"

What determines when an observation of a variable in a dataset created with ODS is stored as the formatted value or the unformatted value?

In this example, I have a simple code that looks something like this:

PROC FREQ DATA=FOO.DEATHCOHORT order=INTERNAL; TITLE "MORTALITY BY &COVAR"; TITLE2 "WHERE MORTAL= &i. "; WHERE METREX92C=&i.; TABLES MORTAL*&COVAR; ODS OUTPUT CrossTabFreqs=cross (KEEP =MORTAL &COVAR FREQUENCY _TYPE_ WHERE= (_TYPE_='11') ); RUN;

A dataset named "cross" is created. In the first iteration of the loop, "Mortal" is being cross tablulated with a variable called "typedeath".

Mortal is coded as a 0/1 variable, typdeath is 0/1/2/3/4, and their formats are as follows:

VALUE MORTALF 0='0 ALIVE' 1='1 DEATH';

VALUE TYPEDEATHF 0='0 NO DEATH' 1='1 CANCER DEATH' 2='2 CARDIO D' 3='3 DIABET D' 4='4 OTHER D';

Unfortunatly, in my work dataset Cross is saved something like this (abridged) Mortal Typedeath Frequency Alive 0 200 Dead 1 10 Dead 2 5

It is interesting to me that the attributes of Mortal and Typedeath are such that the variables are still associated with their formats but are both being displayed differently.

I would like the all of the variables to be saved in the "Cross" dataset as their formatted values. The variable mortal, in this case, is the functional example.

I have several other variables that are formatted in the same fashion as Typedeath, and some of these variable are being saved correctly (and some are not).

I hope I am being clear, and that someone can offer some guidance. My thanks Jeffrey


Back to: Top of message | Previous page | Main SAS-L page