This program aims to generate a comprehensive set of test tables used for the 'Programming 2' course (EPG294). It creates various tables (student demographic data, grades, sports equipment sales in Europe) using static data directly embedded in the code via `datalines4`. The tables are stored in the 'PG2' library.
Data Analysis
Type : INTERNAL_CREATION
All data is contained within the source code (DATALINES4 blocks).
1 Code Block
DATA STEP Data
Explanation : Creation of the CLASS_BIRTHDATE table containing student information (Name, Gender, Age, etc.) with birth dates.
Copied!
data PG2.CLASS_BIRTHDATE;
attrib Name length=$8;
/* ... attributs ... */
infile datalines dsd;
input Name Gender Age Height Weight Birthdate;
datalines4;
/* Données ... */
;;;;
run;
1
DATA PG2.CLASS_BIRTHDATE;
2
attrib Name LENGTH=$8;
3
/* ... attributs ... */
4
INFILEDATALINES dsd;
5
INPUT Name Gender Age Height Weight Birthdate;
6
datalines4;
7
/* Données ... */
8
;;;;
9
RUN;
2 Code Block
DATA STEP Data
Explanation : Creation of the CLASS_QUIZ table containing the results of 5 quizzes for different students.
attrib Name LENGTH=$7FORMAT=$CHAR7. informat=$CHAR7.;
3
/* ... notes quiz ... */
4
INFILEDATALINES dsd;
5
INPUT Name:$7. Quiz1 Quiz2 Quiz3 Quiz4 Quiz5;
6
datalines4;
7
/* Données ... */
8
;;;;
9
RUN;
3 Code Block
DATA STEP Data
Explanation : Creation of a voluminous EU_SPORTS table listing imports/exports of sports products by European country and by year.
Copied!
data PG2.EU_SPORTS;
attrib Sport_Product length=$7;
attrib Geo_Code length=$2;
attrib Country length=$37;
/* ... */
infile datalines dsd;
input Sport_Product Geo_Code Country Year Amt_Import Amt_Export;
datalines4;
/* Données massives import/export ... */
;;;;
run;
1
DATA PG2.EU_SPORTS;
2
attrib Sport_Product LENGTH=$7;
3
attrib Geo_Code LENGTH=$2;
4
attrib Country LENGTH=$37;
5
/* ... */
6
INFILEDATALINES dsd;
7
INPUT Sport_Product Geo_Code Country Year Amt_Import Amt_Export;
8
datalines4;
9
/* Données massives import/export ... */
10
;;;;
11
RUN;
4 Code Block
DATA STEP Data
Explanation : Creation of the CLASS_UPDATE table, probably used for exercises to update existing tables.
Copied!
data PG2.CLASS_UPDATE;
/* ... */
infile datalines dsd;
input Name Sex Age Height Weight;
datalines4;
/* Données ... */
;;;;
run;
1
DATA PG2.CLASS_UPDATE;
2
/* ... */
3
INFILEDATALINES dsd;
4
INPUT Name Sex Age Height Weight;
5
datalines4;
6
/* Données ... */
7
;;;;
8
RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.