![]() Note that regardless of how you have informatted or formatted your SAS dates, the SAS date constant always takes the above form. ![]() The letter d that follows the date in single quotes tells SAS to treat the date string like a constant. , 31), MON denotes the first three letters of the month, and yyyy denotes the four-digit year. In general, a SAS date constant takes the form ' ddMONyyyy'd where dd denotes the day of the month (0. If you don't, as you see here, the dates that are displayed are not particularly user-friendly!įirst, note the form of the SAS date constant: '01jan1960'd ![]() Well, geez, I guess the other thing that the output illustrates is that it is not enough just to tell SAS what informat to use to read in a date's value, but you also have to tell SAS what format to use to display a date's value. As expected, the 01/01/60 birth date is stored as a 0, the 01/01/59 birthdate is stored as -365, and the 12/31/60 birthdate is stored as +365. Note, in particular, the numeric values that are stored for the wt_date and b_date variables. Then, launch and run the SAS program, and review the resulting output to familiarize yourself with the contents of the diet data set. Without it, SAS may attempt to interpret the informat as a variable name instead. Also note that the period is a very important part of the informat name. You could alternatively use hypens (-) or blank spaces between the mm and dd and yy. Here, two of the positions are taken up by forward slashes (/). It tells SAS that the dates to be read into SAS contain as many as 8 positions. defines, in general, the width of the informat. Here, it immediately follows wt_date, and then again follows b_date. informat must immediately follow the date's variable name.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |