BookmarkSubscribeRSS Feed
Sassy_lady
Obsidian | Level 7

I need help with part 1 and 2 of Activity 3.05 from Lesson 3, p103a05. I'm been practicing writing the width and including appropriate decimals places for dates, but for this lesson I'm having trouble.

 

It says to change the width of the date format to 7, but it says to first run the following values Lon, Lat, Startdate, and Enddate then change the date format to 7. Do I write 

proc print data=pg1.storm_summary;
table startdate7 and enddate7;
run; 

 

I have the same questions for part 2 that asks to change it to 11. I'm not receiving the results the activity describes. Thank you to whoever helps me.

2 REPLIES 2
pink_poodle
Barite | Level 11
To change the width of the date format you would need to change the number before the dot in the format statement. Say you have format date9. Its width is 9, so it will show today's date with 9 spaces like 06Jun2022. You can see for yourself by submitting this SAS code and checking the log:
data _null_;
dt=today();
format dt date9.;
put dt ;
run;
If you would like to change the width to 7, the format would be date7. Now today's date will appear as 06Jun22.
tarheel13
Rhodochrosite | Level 12

no. the width is in the format. I showed you in bold what it should be. to change it to 11, you write date11.


proc print data=pg1.storm_summary(obs=20);
	format Lat Lon 4. StartDate EndDate date7.;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 336 views
  • 0 likes
  • 3 in conversation