Hi all,
I know there's a few posts regarding this topic but none has worked in my situation.
I get a log message for date9, format:
20 ;
NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21
22 GOPTIONS ACCESSIBLE;
23 data adsl1;
24 merge adsl(in=a)
25 ecall
26 ;
27 by studyid usubjid;
28
29
30 ***col6;
31 ecstdtc_=substr(ecstdtc,1,10);
32 col6= strip(put(ecstdtc_, date9.));
______
484
NOTE 484-185: Format $DATE was not found or could not be loaded.33 run;
data:
code:
data adsl1;
merge adsl(in=a)
ecall
;
by studyid usubjid;
***col6;
ecstdtc_=substr(ecstdtc,1,10);
col6= strip(put(ecstdtc_, date9.));
run;
So you took the first 10 characters of a string and tried to use the PUT() function to apply a NUMERIC format to it. SAS very kindly assumed you just forgot to include the $ in your format specification and so it added one. But then it could not find any character format named $DATE.
Do you want to create a DATE value?
col6 = input(ecstdtc, yymmdd10.);
format col6 date9.;
Or do you want to create another string that also looks like a date, only this time showing the date in a different style?
col6 = put(input(ecstdtc, yymmdd10.),date9.);
please post the code that generated this log?
Please run PROC CONTENTS on data set adsl and SHOW US if this variable ecstdtc is numeric or character.
@HitmonTran wrote:
Hi all,
I know there's a few posts regarding this topic but none has worked in my situation.
I get a log message for date9, format:
662 col5= strip(put(rficdt, date9.)); 663 664 665 ***col6; 666 *if BRTHDTC ne "" then BRTHDT= input(substr(strip(BRTHDTC),1,10),is8601da.); 667 col6= strip(put(BRTHDTC, date9.)); ______ 484 NOTE 484-185: Format $DATE was not found or could not be loaded.
data:
Please describe what you are attempting to do. In considerable detail.
Your Brthdtc variable appears to be a character value that looks like a year. As such it is inappropriate to attempt to use a date valued format like date9 in any form. Also if the value is only a year then what date of a year would you want that to represent??
Since your date variable RFICDT is already formatted as date9., there doesn't seem to be much point in turning it into a character string. Any time SAS has to use this variable, it will ALWAYS display it as date9.
So the answer to your problem is to do nothing. Write no code! Problem solved.
Unless there's something you haven't explained as to why you need a character string here.
@HitmonTran wrote:
Hi Paige,
I updated the post with another example. Can you please take a look? Thank you
As others have asked, would you please explain why you are doing this if you already have a string of text (either a formatted number or an actual character string) that appears to be in DATE9. format?
So you took the first 10 characters of a string and tried to use the PUT() function to apply a NUMERIC format to it. SAS very kindly assumed you just forgot to include the $ in your format specification and so it added one. But then it could not find any character format named $DATE.
Do you want to create a DATE value?
col6 = input(ecstdtc, yymmdd10.);
format col6 date9.;
Or do you want to create another string that also looks like a date, only this time showing the date in a different style?
col6 = put(input(ecstdtc, yymmdd10.),date9.);
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.