Prev: Do we need a NORETAIN statement? was: about full join problem
Next: PROC REPORT pagination order?
From: John Birken on 9 Dec 2009 13:50 From: Fehd, Ronald J. CDC/CCHIS/NCPHI To: Birken, John A. CDC/CCHIS/NCHS Ron: Thanks for your suggestion: A single attrib statement did not work on two datasets of 12 columns each. Applying your statement to all 12 columns of both data sets and voila the comma and decimal point and format became correct. For the record here's what worked: Data CURRYR.calcRates; attrib C_1R length = $ 8; attrib C_2R length = $ 8.; . . attrib C_12 length = $ 8.; set CURRYR.calcRates; run; Data CURRYR.&LastYearTRENDATA; attrib C_1R length = $ 8; attrib C_2R length = $ 8.; . . attrib C_12 length = $ 8.; set CURRYR.&LastYearTRENDATA; run; * Appending this year's data to all prior year trend files ; PROC APPEND BASE=CURRYR.LastYearTRENDATA DATA =CalcRates FORCE; RUN ; correctly produced 1,007.6 1,807.9 24.9 ......... 14,377.2 John, jbirken(a)cdc.gov _________________________________________________________________________ You need to change the attributes of your variable on the base data set before you can append the new data set with the longer variable. Data Library.Old; attrib C_1R length = $ 8; set Library.Old; Ronald J. Fehd, IT Spec CDC/CCHIS/NCPHI listserv admin: CDC_SAS, CDC_SPSS, CDC_Sudaan, CDC_Splus team lead: Statistical Software and Knowledge Worker Support HelpDesk Level 3: SAS CDC SAS site representative bus: 404.498.2421 > -----Original Message----- > From: owner-sas-l(a)listserv.uga.edu > [mailto:owner-sas-l(a)listserv.uga.edu] On Behalf Of Birken, > John A. (CDC/CCHIS/NCHS) > Sent: Thursday, December 03, 2009 6:00 PM > To: SAS-L(a)LISTSERV.UGA.EDU > Cc: Birken, John A. (CDC/CCHIS/NCHS) > Subject: When Appending Where's the Wanted Comma? > > I have a 1000+ page report which produces good values. > One column will not display a 4 digit number with a comma. > Changing: > > C_1R = PUT(R_1,COMMA6.1) ; TO C_1R = PUT(R_1,COMMA8.1) ; > > changes 1339.2 TO 1339. I want 1,339.2 > I suspect it's due to the fact that I am appending seven years of data > whose column 2 is comma6.1 data. The new data column is > comma8.1 to house > the new data with a comma > > PROC APPEND BASE=WorkTrendOld DATA = CalcRatesNewYear FORCE; RUN; > > produces > > NOTE: Appending WORK.CalcRatesNewYear to CURRYR.WorkTrendOld. > WARNING: Variable C_1R has different lengths on BASE and > DATA files (BASE 6 DATA 8). > > How can I force WorkTrendOld.sas7bdat to combine with > CalcRatesNewYear.sas7bdat to give me a second column comma - > N,MMM.P the > format. Some other columns have the correct format. Another > view is how to > add 2 spaces to Var 2 in WorkTrendOld. > Changing column 2 to a good column format - Currently > comma8.1 makes things > worse(1339.2 to 1339.). > > TIA, > > John jbirken(a)cdc.gov, caraj(a)cox.net > >
|
Pages: 1 Prev: Do we need a NORETAIN statement? was: about full join problem Next: PROC REPORT pagination order? |