Path to mathematics-sas memo (10), path to mathematics-sas memo

Source: Internet
Author: User

Path to mathematics-sas memo (10), path to mathematics-sas memo

Merge combines two or more data sets.

Libname saslib "k: \ sas ";

DataSaslib. goodsprice;

Input id name $ price6.2;

Datalines;

1 mouse 35.6

2 Keyboard 28.95

3 mouse pad 8.2

4 headsets 29.7

;

DataSaslib. goodsquantity;

Input id quantity;

Datalines;

1 150

2 98

4 162

3 45

;

Proc sortData = saslib. goodsprice;

By id;

Proc sortData = saslib. goodsquantity;

By id;

DataSaslib. mygoods;

Merge saslib. goodspricesaslib. goodsquantity;

By id;

Run;

Proc printData = saslib. mygoods;

Run;

 

All content of this blog is original, if reproduced please indicate the source http://blog.csdn.net/myhaspl/

You can also use update, but update can only operate on two datasets.

Libname saslib "k: \ sas ";

DataSaslib. goodsprice;

Input id name $ price6.2;

Datalines;

1 mouse 35.6

2 Keyboard 28.95

3 mouse pad 8.2

4 headsets 29.7

;

DataSaslib. goodsquantity;

Input id quantity;

Datalines;

1 150

2 98

4 162

3 45

;

Proc sortData = saslib. goodsprice;

By id;

Proc sortData = saslib. goodsquantity;

By id;

DataSaslib. mygoods;

Update saslib. goodspricesaslib. goodsquantity;

By id;

Run;

Proc printData = saslib. mygoods;

Title 'computer peripheral production ';

Run;

Libname saslib "k: \ src \ sas ";

DataSaslib. goodsprice;

Input id name $ price6.2;

Datalines;

1 mouse 35.6

2 Keyboard 28.95

3 mouse pad 8.2

4 headsets 29.7

;

DataSaslib. goodsquantity;

Input id quantity;

Datalines;

1 150

2 98

4 162

3 45

;

Proc sortData = saslib. goodsprice;

By id;

Proc sortData = saslib. goodsquantity;

By id;

 

DataSaslib. mygoods;

Update saslib. goodspricesaslib. goodsquantity;

By id;

Run;

Proc printData = saslib. mygoods;

Title 'computer peripheral production ';

Run;



Related Article

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.