- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I am reading page 293 of the Advanced Prep guide 4e. It uses a file called sasuser.all
but the file I downloaded from the books website is in sas7bvew.
if I double click it, it would be downloaded as a text file with all gibberish like this
How can I read this sas7bvew file in SAS studio?
Thanks in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Okay, I found the solution. It is probably because I skipped the Proc SQL part of the book and when straight to Macro language part.
Note to myself or future readers of the book, to create the sasuser.all dataset used in the book, use the code below, and change the four tables to your own path (eg, a.SCHEDULE to yourpath.SCHEDULE)
proc sql; create table a.all2 as select students.student_name, schedule.course_number, paid, courses.course_code, location, begin_date, teacher, course_title, days, fee, student_company, city_state from a.SCHEDULE, a.STUDENTS, a.REGISTER, a.COURSES where (schedule.course_code = courses.course_code) and (schedule.course_number = register.course_number) and (students.student_name = register.student_name) order by students.student_name asc, courses.course_code asc; run;
Table name can't be yourpath.all because all.sas7bvew already exist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is a view, not a table.
https://documentation.sas.com/doc/en/pgmsascdc/v_036/engsas7bdat/p095ej3hnyskg7n1xdwmm71q6upf.htm
You can access the code for a view using Describe in either proc sql or via data step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
okay, I described the view with proc sql.
and I got
how can I turn it so that I can use it as a data set so that I can follow the original code used in the book?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
proc tabulate data = a.all;
< More statements>;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I don't understand.
proc tabulate data = a.all;
just gives me error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
oh wait I think I got the idea.
I prpb have to create a new data set from the SQL code that's stored in the all.sas7bvew.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Okay, I found the solution. It is probably because I skipped the Proc SQL part of the book and when straight to Macro language part.
Note to myself or future readers of the book, to create the sasuser.all dataset used in the book, use the code below, and change the four tables to your own path (eg, a.SCHEDULE to yourpath.SCHEDULE)
proc sql; create table a.all2 as select students.student_name, schedule.course_number, paid, courses.course_code, location, begin_date, teacher, course_title, days, fee, student_company, city_state from a.SCHEDULE, a.STUDENTS, a.REGISTER, a.COURSES where (schedule.course_code = courses.course_code) and (schedule.course_number = register.course_number) and (students.student_name = register.student_name) order by students.student_name asc, courses.course_code asc; run;
Table name can't be yourpath.all because all.sas7bvew already exist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Proc SQL feedback;
select * from sasuser.all;
quit;