|
|||
|
Mark has given you good advice. There is one other possibility. Are you
absoluely sure that PRODTOO is not created in any other way. Try to write the value of PRODTOO to the log and see if you see anything different. It is worth checking. Run this to see what I mean: data test ; dlp = "K23" ; product = put ( dlp , $dprodl. ) ; prodtoo = put ( dlp , $dprodi. ) ; if substr ( dlp , 1 , 1 ) = "K" then product = prodtoo ; put (_all_) (=) ; run ; title "Good PRODTOO" ; proc freq data = test ; tables dlp*product*prodtoo / list missing ; run ; data test2 ; dlp = "K23" ; product = put ( dlp , $dprodl. ) ; prodtoo = put ( " " || dlp , $dprodi. ) ; if substr ( dlp , 1 , 1 ) = "K" then product = prodtoo ; put (_all_) (=) ; run ; title "Corrupt PRODTOO" ; proc freq data = test2 ; tables dlp*product*prodtoo / list missing ; run ; Good luck. Venky On Thu, 2 Jun 2005 15:58:56 -0400, Pat Malarkey <patricia_malarkey@FREDDIEMAC.COM> wrote: >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 |
|
|
||||
|
||||
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ORACLE prepare error: ORA-00923: FROM keyword not found where expected. | sunchunkui@hotmail.com | Newsgroup comp.soft-sys.sas | 1 | 08-02-2005 04:23 PM |
| Re: ORACLE prepare error: ORA-00923: FROM keyword not found where | Carol Bristow | Newsgroup comp.soft-sys.sas | 0 | 08-02-2005 03:25 PM |
| Re: User Format - Strange Behavior - RESOLVED! | toby dunn | Newsgroup comp.soft-sys.sas | 0 | 06-06-2005 09:49 PM |
| Re: User Format - Strange Behavior | Terjeson, Mark | Newsgroup comp.soft-sys.sas | 0 | 06-02-2005 08:39 PM |
| User Format - Strange Behavior | Pat Malarkey | Newsgroup comp.soft-sys.sas | 0 | 06-02-2005 07:58 PM |