Thursday, 6 October 2011

Create a dataset from the internal data:

Rules for dataset name and variable names:

  • Dataset name or variable name given up to 32 characters.
  • Starts with letter (a-z, A-Z) or underscore ( _ ).
  • Number can be used (0 to 9).
  • Cannot be used any special character (16  special character) except underscore  ( _ ).
Note: Code can be written in mixed case (small letters or capitals ). Each SAS statement ends with 
semicolon (;).

Infile Statement: Access or capture the data from internal or external location into SAS ( internal memory location ).

Input Statement: Read and load the data into dataset with variables names.

Cards or Datalines: To represent internal data in application.

Note: Dataset block must be closed with semicolon (;) or run statement.     

Submisssion of SAS application: F3 or F8                                                              

Data employ;
Infile cards;
Input eid des $ salary;
cards;
101 Tester 200
102 Progmer 2900                                                                     Application
103 Analyst 3400
;
                                                                                                                                    


Capture Mixed Data:
Mixed data reading format is character
Data mh;
Infile cards;
Input pid visit $ drug $;
cards;
101 Visit1  Asp-05mg
102 Visit1 Asp-10mg
103 Visit1 Asp-15mg
101 Visit2 Asp-05mg
102 Visit2 Asp-10mg
103 Visit2 Asp-15mg
;

Delimiter:  In raw data, data values are separated by anyone special character. These special Characters are  
called as delimiter (default delimiter is space).
            

No comments:

Post a Comment