Question

14. Write a SAS program to do the following tasks in order. You must label each...

14. Write a SAS program to do the following tasks in order. You must label each question in the program by using comment statement like /* Q14a */ on the line where your answers to Q14a begin.

a.   Define the Library Q14A using LIBNAME statement to connect to the SASData folder inside STA575 folder on the U-drive.

b.   Define the Library Q14B using LIBNAME statement to connect to a new folder Q14DATA inside STA575 folder on the U-drive. Create a new folder ‘NDATA’ inside ‘STA575’ folder on U-drive.

c.   Write a data step to read the SAS data set ‘Credit’ from the library Q14A into the library Q14B using the data set name CreditAS1. Make sure the SAS data set is properly read into the library Q14B.

d.   Use PROC CONTENTS to see the descriptor portion of the data set CreditAS1.

e.   By including the option VARNUM, use PROC DATASETS to see the descriptor portion of the data set CreditAS1.

f.    Print the entire data set CreditAS1. [Note that the data is in the Q14B library.]

NOTE: After the program runs correctly, clear the SAS Log (go to SAS Log window, right click, Edit, Clear All), and run the entire program once. Then, organize your report all in one file as follows:

This is in SAS 9.4 preferably

ans format

Q14: Results must be included on the Answer Sheet

Part 1: Your SAS program

Part 2: The SAS LOG

Part 3: The output.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

/* To define library */

** In quotes you have to mention the exact path of the folder;

/*Part a*/

libname Q14A "U:/STA575";

/* To define new library Q14B */

/*Part b*/

libname Q14A "U:/STA575/Q14DATA";

/*Part c*/

/* Create data set credit from Q14A into the library Q14B using Dataset name creditAS1 */

data Q14B.credit; /** Output dataset credit in library Q14B */

set Q14A.creditAS1; /** Read dtaaset creditAS1 from library Q14A */

run;

/* Part D */

/* To see the descriptor prtion of dataset */

proc contents data = Q14A.CreditAS1 order = varnum ;

run;

/* Part E */

/* Varnum option Print a list of the variables by their position in the data set.

By default, the CONTENTS statement lists the variables alphabetically.*/

proc contents data = Q14A.creditAS1 order = varnum ;

run;

proc datasets memtype=Q14A.creditAS1;

   contents data=_all_ order = varnum ;

run;

/* Part F */

/* Print dataset creditAS1 (dataset is in library QS14B) */

/* Right now data is in library QS14A , so read it in library QS14B then print the dataset */

data qs14B.creditAS1;

set QS14A.creditAS1;

run;

proc print data = qs14B.creditAS1 ;

run;

Add a comment
Know the answer?
Add Answer to:
14. Write a SAS program to do the following tasks in order. You must label each...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Copy/paste this data on online orders into SAS. Write a program that will read it including...

    Copy/paste this data on online orders into SAS. Write a program that will read it including date informats; create a variable, called WaitTime, that is the number of days between Order and Delivery. Use an IF statement to give a value of 0 if the Delivery date is missing; recode the categories of method of payment, changing C to Credit and P to Paypal; print the data set using a different date format than the informat; and do proc means...

  • Use C++ For this week’s lab you will write a program to read a data file...

    Use C++ For this week’s lab you will write a program to read a data file containing numerical values, one per line. The program should compute average of the numbers and also find the smallest and the largest value in the file. You may assume that the data file will have EXACTLY 100 integer values in it. Process all the values out of the data file. Show the average, smallest, largest, and the name of the data file in the...

  • Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that...

    Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that will process monthly sales data for a small company. The data will be used to calculate total sales for each month in a year. The monthly sales totals will be needed for later processing, so it will be stored in an array. Basic Logic for main() Note: all of the functions mentioned in this logic are described below. Declare an array of 12 float/doubles...

  • For this c++ assignment, Overview write a program that will process two sets of numeric information....

    For this c++ assignment, Overview write a program that will process two sets of numeric information. The information will be needed for later processing, so it will be stored in two arrays that will be displayed, sorted, and displayed (again). One set of numeric information will be read from a file while the other will be randomly generated. The arrays that will be used in the assignment should be declared to hold a maximum of 50 double or float elements....

  • Write a c++ program in that file to perform a “Search and Replace All” operation. This...

    Write a c++ program in that file to perform a “Search and Replace All” operation. This operation consists of performing a case-sensitive search for all occurrences of an arbitrary sequence of characters within a file and substituting another arbitrary sequence in place of them. Please note: One of the biggest problems some students have with this exercise occurs simply because they don’t read the command line information in the course document titled “Using the Compiler’s IDE”. Your program: 1. must...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • Program 7 Arrays: building and sorting (100 points) Due: Friday, October 30 by 11:59 PM Overview...

    Program 7 Arrays: building and sorting (100 points) Due: Friday, October 30 by 11:59 PM Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be...

  • CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program...

    CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program will play music from a text file. Objectives Working with lists Background This project addresses playing music. A song consists of notes, each of which has a length (duration) and pitch. The pitch of a note is described with a letter ranging from A to G.   7 notes is not enough to play very interesting music, so there are multiple octaves; after we reach...

  • If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but...

    If you’re using Visual Studio Community 2015, as requested, the instructions below should be exact but minor discrepancies may require you to adjust. If you are attempting this assignment using another version of Visual Studio, you can expect differences in the look, feel, and/or step-by-step instructions below and you’ll have to determine the equivalent actions or operations for your version on your own. INTRODUCTION: In this assignment, you will develop some of the logic for, and then work with, the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT