SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Multiple Observations from a Single Record
Reading Repeating Blocks of Data


Completing the DATA Step

You can add a FORMAT statement to the DATA step to display the date or time values with a specified format in the data set. In the FORMAT statement below, the DATEw. format is used to display the values for Date in the form ddmmmyy.

     data perm.april90;  
        infile tempdata;
        input Date : date. HighTemp @@;
        format date date7.; 

Raw Data File Tempdata
1---+----10---+----20---+----30--
01APR90 68 02APR90 67 03APR90 70
04APR90 74 05APR90 72 06APR90 73
07APR90 71 08APR90 75 09APR90 76


A RUN statement completes the DATA step.

     data perm.april90;  
        infile tempdata;
        input Date : date. HighTemp @@;
        format date date7.;        
     run; 

back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement