Study Notes on the business case of SAS programming and Data Mining

Source: Internet
Author: User

Continue with the previous Reading Notes, talk nonsense, and go straight to the topic.

This article focuses on the infile statement.

11: infile statement

DSDIt is required that a dataset can contain delimiters, but must be enclosed in quotation marks. The number between two consecutive delimiters is treated as missing values,The default Delimiter is comma.

Firstobs = Read from this record row

Obs =   Number of records to be read

Length = virableAssign the Data Length of the current row to the Temporary Variable variable.

Missover Prevents the input statement from reading data from the next data row, and sets the variable to missing for the value assignment.

Eg:

Filename file 'f: \ data_model \ book_data \ chapt3 \ utf.txt ';

Data Unicode;

  Infile file encoding = "UTF-8 ";

  Input name $ weight;

Run;

Import a file in the specified encoding format

 

Eg:

Data num;

  Infile datalines dsd dlm = '';

  Input x y z;

  Datalines;

 2 3

4 5 6

79

;

Run;

DSD and DLM can be used together for missing values.

 

Eg:

Data weather;

  Infile datalines missover;

  Input temp1-temp5;

  Datalines;

97.9 98.1 98.3

98.6 99.2 99.1 98.5 97.5

96.2 97.3 98.3 97.6 96.5

;

Run;

The data at the end of the first row is missing. At this time, the missover is used to force the Data Pointer to read the values of all input variables corresponding to each row.

Study Notes on the business case of SAS programming and Data Mining

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.