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 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 2 Jun 2005 15:58:56 -0400
Reply-To:     Pat Malarkey <patricia_malarkey@FREDDIEMAC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Pat Malarkey <patricia_malarkey@FREDDIEMAC.COM>
Subject:      User Format - Strange Behavior
Content-Type: text/plain; charset=ISO-8859-1

All -

Here's one that's got me scratching my head!

I have a .txt file with some formats in it (small excerpt):

PROC FORMAT; VALUE $DPRODI "K23" = "ARM" "K24" = "ARM" "K25" = "ARM" "K26" = "ARM" "K27" = "ARM" "K28" = "ARM" "K49" = "ARM" "K50" = "ARM" "K51" = "ARM" "K52" = "ARM" "K53" = "ARM" "K54" = "ARM" "K55" = "ARM" "K56" = "ARM" "K57" = "ARM" "K58" = "ARM" "K59" = "ARM" OTHER = "BAD PRODUCT" ; PROC FORMAT; VALUE $DPRODL "K23" = "BALLOONS" "K24" = "BALLOONS" "K25" = "BALLOONS" "K26" = "BALLOONS" "K27" = "BALLOONS" "K28" = "BALLOONS" "K49" = "BALLOONS" "K50" = "BALLOONS" "K51" = "BALLOONS" "K52" = "BALLOONS" "K53" = "BALLOONS" "K54" = "BALLOONS" "K55" = "BALLOONS" "K56" = "BALLOONS" "K57" = "BALLOONS" "K58" = "BALLOONS" "K59" = "BALLOONS" OTHER = "BAD PRODUCT" ;

I %include this file and then run this code on an existing dataset w/ column dlp (the start value in the format):

data mytest; set myfile; PRODUCT=PUT(DLP,$DPRODL.); PRODTOO=PUT(DLP,$DPRODI.); IF SUBSTR(DLP,1,1)='K' THEN DO; PRODUCT=PRODTOO; run; proc freq data=mytest; tables dlp*product*prodtoo / list missing; run;

On PC and mainframe, here are the results of the proc freq:

The SAS System 10:56 Thursday, June 2, 2005 1

The FREQ Procedure

Cumulative Cumulative DLP PRODUCT PRODTOO Frequency Percent Frequency Percent

ャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャャ ャ K23 ARM ARM 54 1.40 54 1.40 K53 ARM ARM 385 9.96 439 11.35 K54 ARM ARM 732 18.93 1171 30.28 K57 ARM ARM 747 19.32 1918 49.60 K58 ARM ARM 1616 41.79 3534 91.39 K59 ARM ARM 333 8.61 3867 100.00

And here are the results on unix (Sun Solaris-64):

The SAS System 11:18 Thursday, June 2, 2005 1

The FREQ Procedure

Cumulative Cumulative DLP PRODUCT PRODTOO Frequency Percent Frequency Percent ----------------------------------------------------- --------------------------------- K23 BAD PRODUCT BAD PRODUCT 54 1.40 54 1.40 K53 BAD PRODUCT BAD PRODUCT 385 9.96 439 11.35 K54 BAD PRODUCT BAD PRODUCT 732 18.93 1171 30.28 K57 BAD PRODUCT BAD PRODUCT 747 19.32 1918 49.60 K58 BAD PRODUCT BAD PRODUCT 1616 41.79 3534 91.39 K59 BAD PRODUCT BAD PRODUCT 333 8.61 3867 100.00

Help?

TIA - Pat


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