[SAS base] outputs a simple report using the file statement and put statement.

Source: Internet
Author: User

 1 Data _ NULL; /*  _ Null _ makes it unnecessary for the system to generate a new dataset to save memory.  */  2 Infile '  C: \ myrawdata \ candy. dat  '  ;  3 Input name $ 1 - 11  Class @ 15  Datereturned mmddyy10. candytype $ quantity;  4 Profit = Quantity * 1.25  ;  5   6   /*  Focus: output reports using file and put  */  7 File '  C: \ myrawdata \ student.txt  ' Print;/*  The file statement specifies the output path of the reprot. The print option tells SAS to include the carriage return and paging character.  */  8 Title; /*  Zero title statement command SAS removes all default titles  */  9 Put @ 5 'Candy sales report For   '  Name  '  From Classroom ' Class  10             //  @ 5'congratulations! You sold 'quantity 'boxes of candy  11 /@ 5   '  And earned  ' Profit dollar6. 2   '  For our field trip  '  ;  12 Put _ page _;/*  Insert a paging character in each student's report  */  13 Run;

Note:

    • The put statement is similar to the input statement, which can be list, column, or formatted style. However, because sas already knows whether the numeric type is variable or numeric type, you do not need to add $ to the variable;
    • Like the example, the output can be combined in strings and variables.

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.