Hello. I am trying to learn more about how the cre8data.sas works and solve a problem. We have a SAS Studio solution running on our campus and an instructuor is using SAS training materials. The current cre8data.sas includes a setup.sas and p199d00.sas. The setup worked correctly on our system and populated our test user folder just fine in SAS Studio.
The instructor has another zip folder "pg194.zip" that has data and sas files but does not include a cre8data.sas or setup file, but does include the p194.sas script.
A couple questions?
1. Can I modify the cre8data.sas and setup.sas files to work with pg194, if so, can you provide a link to documentation?
2. Are the files (cre8data.sas and setup.sas) available for the pg194 and can be shared?
Thanks.
Please do not jump to conclusions. I am working with very limited information here.
Best would be to provide the code of the PG194.SAS file. Then we can ask intelligent questions about what you already have.
Typically I would expect to see something related to 1) assigning SAS library 2) and code to read any input files.
There is likely nothing "magic" about either of your Cre8data or Setup SAS program file names, the important part is the content of the code.
Did your instructor provide any additional instruction in class or a documentation file in the ZIP archive with what to do?
Attached is the p194.sas file. I believe that it generates data sets. I included only a snippet.
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARNING: STUDENTS, DO NOT EXECUTE THIS PROGRAM! INSTEAD,
EXIT AND EXECUTE THE CRE8DATA.SAS PROGRAM TO SETUP
YOUR COURSE DATA ENVIRONMENT.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WARNING: DO NOT ALTER CODE BELOW THIS LINE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
options linesize=256;
data PG1.CLASS_BIRTHDATE;
attrib Name length=$8;
attrib Sex length=$1;
attrib Age length=8;
attrib Height length=8;
attrib Weight length=8;
attrib Birthdate length=8;
infile datalines dsd;
input
Name
Sex
Age
Height
Weight
Birthdate
;
datalines4;
Alfred,M,14,69,112.5,16370
Alice,F,13,56.5,84,16756
Barbara,F,13,65.3,98,16451
Carol,F,14,62.8,102.5,16256
Henry,M,14,63.5,102.5,16406
James,M,12,57.3,83,16967
Jane,F,12,59.8,84.5,16873
Janet,F,15,62.5,112.5,15797
Jeffrey,M,13,62.5,84,16552
John,M,12,59,99.5,17036
Joyce,F,11,51.3,50.5,17169
Judy,F,14,64.3,90,16410
Louise,F,12,56.3,77,17021
Mary,F,15,66.5,112,15790
Philip,M,16,72,150,15665
Robert,M,12,64.8,128,16958
Ronald,M,15,67,133,15992
Thomas,M,11,57.5,85,17243
William,M,15,66.5,112,16067
;;;;
run;
data PG1.CLASS_TEACHERS;
attrib Name length=$8;
attrib Grade length=8;
attrib Teacher length=$12;
infile datalines dsd;
input
Name
Grade
Teacher
;
datalines4;
Alfred,8,Thomas
Alice,7,Evans
Barbara,6,Smith
Carol,8,Thomas
Henry,8,Thomas
James,6,Smith
Jane,5,Garcia
Janet,9,Jones
Jeffrey,7,Evans
John,6,Smith
Joyce,5,Garcia
Judy,8,Thomas
Louise,6,Smith
Mary,9,Jones
Philip,10,Williams
Robert,7,Evans
Ronald,10,Williams
Thomas,6,Smith
William,9,Jones
;;;;
run;
data PG1.CLASS_TEST2;
attrib Name length=$7;
attrib Subject length=$7;
attrib TestScore length=8;
infile datalines dsd;
input
Name
Subject
TestScore
;
datalines4;
Judy,Math,97
Judy,Reading,91
Barbara,Math,96
Barbara,Reading,86
Louise,Math,92
Louise,Reading,99
James,Math,90
James,Reading,85
Joyce,Math,88
Joyce,Reading,75
William,Math,87
William,Reading,87
Henry,Math,85
Henry,Reading,86
Jane,Math,84
Jane,Reading,76
Alfred,Math,82
Alfred,Reading,79
Mary,Math,81
Mary,Reading,84
Janet,Math,75
Janet,Reading,71
Philip,Math,73
Philip,Reading,80
Alice,Math,71
Alice,Reading,67
Robert,Math,71
Robert,Reading,72
Thomas,Math,70
Thomas,Reading,68
John,Math,68
John,Reading,73
Ronald,Math,66
Ronald,Reading,62
Carol,Math,61
Carol,Reading,57
Jeffrey,Math,55
Jeffrey,Reading,63
;;;;
run;
data PG1.CLASS_TEST3;
attrib Name length=$7;
attrib Subject length=$7;
attrib TestScore length=8;
infile datalines dsd;
input
Name
Subject
TestScore
;
datalines4;
Judy,Math,97
Judy,Reading,91
Barbara,Math,96
Barbara,Reading,86
Barbara,Math,96
Louise,Math,92
Louise,Reading,99
James,Math,90
James,Reading,85
Joyce,Math,88
Joyce,Reading,75
William,Math,87
William,Reading,87
Henry,Math,85
Henry,Math,90
Henry,Reading,86
Jane,Math,84
Jane,Reading,76
Alfred,Math,82
Alfred,Reading,79
Mary,Math,81
Mary,Reading,84
Janet,Math,75
Janet,Reading,71
Philip,Math,73
Philip,Reading,80
Alice,Math,71
Alice,Reading,67
Robert,Math,71
Robert,Reading,72
Thomas,Math,70
Thomas,Reading,68
John,Math,68
John,Reading,73
Ronald,Math,66
Ronald,Reading,62
Carol,Math,61
Carol,Reading,57
Jeffrey,Math,55
Jeffrey,Reading,63
;;;;
run;
data PG1.CLASS_UPDATE;
attrib Name length=$8;
attrib Sex length=$1;
attrib Age length=8;
attrib Height length=8;
attrib Weight length=8;
infile datalines dsd;
input
Name
Sex
Age
Height
Weight
;
datalines4;
Alfred,M,14,69,112.5
Alice,F,13,56.5,84
Barbara,F,13,65.3,98
David,M,11,55.3,73
Henry,M,14,63.5,102.5
James,M,12,57.3,83
Jane,F,12,59.8,84.5
Janet,F,15,62.5,112.5
Jeffrey,M,13,62.5,84
John,M,12,59,99.5
Joyce,F,11,51.3,50.5
Judy,F,14,64.3,90
Louise,F,12,56.3,77
Mary,F,15,66.5,112
Philip,M,16,72,150
Robert,M,12,64.8,128
Ronald,M,15,67,133
Thomas,M,11,57.5,85
William,M,15,66.5,112
;;;;
run;
data PG1.EU_OCC;
attrib Geo length=$2 label='Country Code';
attrib Country length=$40 label='Reporting Country';
attrib YearMon length=$8 label='Year Month';
attrib Hotel length=8 label='Nights Spent at Hotels';
attrib ShortStay length=8 label='Nights Spent at Short Stay Accommodations';
attrib Camp length=8 label='Nights Spent at Camp Grounds or RV Parks';
infile datalines dsd;
input
Geo
Country
YearMon
Hotel
ShortStay
Camp
;
datalines4;
AT,Austria,2017M09,7768564,1453530,524121
AT,Austria,2017M08,11353432,3140217,1997801
AT,Austria,2017M07,10124106,2836425,1752605
AT,Austria,2017M06,7391827,1568683,914560
Do you actually want to run that program? It says on the top not to run it.
If you did want to run that program then before running it you will need to define the PG1 libref pointing to some place where you can create files. Something like:
libname pg1 '/folder/for/class';
%include 'p184.sas' / source2;
If your intent is to run it once and let students access the dataset then point to a directory that the students have readonly access and run it using a userid that has write access. If the students have write access then one of them is bound to destroy some of all of the datasets or create other datasets in that folder by mistake.
No intention to run this as a stand-alone.
Yes. This is what I am leaning towards. We are working in a Linux environment and may just copy all of the needed files over to the user folders.
Thanks.
I do not have much information from the instructor. Classes have started, and everybody has limited time. Thanks for the information.
D.
Also, some of that content is under copyright, you may need to verify with the professor that they have the appropriate licensing for the content they're using.
@DWhite wrote:
I do not have much information from the instructor. Classes have started, and everybody has limited time. Thanks for the information.
D.
How is licensing applied. We have campus-wide licensing for SAS Studio, SAS VA, Enterprise Miner, SAS DIS, and others.
Hi:
With a University license, you should be OK using SAS. I am worried about the files that your instructor gave you and where he got them and how they are intended to be used. They seem close to the files we use for our courses, but seem to be modified. This is really not something that anyone here can resolve for you. Your instructor will have to go back to the group/person who gave him the files and ask them to send him working files for the class material he's using.
Cynthia
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.