data CCA;
b = '2Jan1583'd;
run;
proc print data = CCA;
format b weekdate31.;
run;
why it is 'NOV' ?
@tianerhu wrote:
I am sorry . the year is not 1583 , is 1582 , the following is the revised code :
data CCA; b = '1Jan1582'd; run; proc print data = CCA; format b weekdate31.; run;
From the documentation on dates:
data CCA; do b = '1Jan1582'd to '15Nov1582'd ; output; end; run; proc print data = CCA; format b weekdate31.; run;
It's not?
I ran your code and this is what I get in SAS ODA.
| Obs | b |
|---|---|
| 1 | Sunday, January 2, 1583 |
@tarheel13 wrote:
It's not?
I ran your code and this is what I get in SAS ODA.
Obs b 1 Sunday, January 2, 1583
Same with SAS 9.4.4
I am sorry . the year is not 1583 , is 1582 , the following is the revised code :
data CCA;
b = '1Jan1582'd;
run;
proc print data = CCA;
format b weekdate31.;
run;
Okay. I see the same as you. But why are you using a date from the 1500s?
Okay. If you use different years like 1982 or 2003, it won't show 'NOV' at the beginning.
Well, the good news is I feel like it is pretty unlikely that you would ever work with date values from the 1500s loll.
@tianerhu wrote:
I am sorry . the year is not 1583 , is 1582 , the following is the revised code :
data CCA; b = '1Jan1582'd; run; proc print data = CCA; format b weekdate31.; run;
From the documentation on dates:
data CCA; do b = '1Jan1582'd to '15Nov1582'd ; output; end; run; proc print data = CCA; format b weekdate31.; run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.