DataGym Center
DataGym Center
  • Видео 10
  • Просмотров 19 030
Subsetting Data Using the WHERE statement in SAS
In this tutorial, I explained the various ways the "where'" statement can be used in SAS to extract or subset dataset. This comes very handle when you have a large dataset but only want to use a small part of the data.
The following are the codes I used for the tutorial:
*%Let dir = E:\SAS_tutorials\; * Change to your path;
*%Let dat_in = athlete_events; * Change to your excel file;
lIBNAME olym "&dir";
*-------- IMPORT --------;
PROC IMPORT
DATAFILE= "&DIR.&dat_in"
DBMS=xlsx REPLACE
OUT= olympics;
SHEET = "athletes";
GETNAMES=YES;
RUN;
proc print data=olympics (obs=5);run;
ods select Position;
proc contents data=olympics varnum;quit;
ods select all;
dm'log;clear;output;clear;odsresults;clear;';...
Просмотров: 1 719

Видео

Introduction to R - Run your first Basic Data Analysis in R in ONE HOUR
Просмотров 1065 лет назад
Run your first data analysis in R after watching this video. The tutorial gets you started easy and straightforward. You learn the following in ONE HOUR: 1. Install R and Rstudio 2. Run some basic analyses 3. Run your first dataset from attached packages 4. Set the working directory 5. Export data to CSV file 6. Import CSV file 7. Introduction to RCMDR - R's Graphical User Interface (GUI) for f...
SAS - Import Multiple Excel Sheets the Fastest way
Просмотров 4,3 тыс.5 лет назад
Hello everyone. Again, welcome to DataGym Center. In this last episode of data import into SAS, I show you the fastest, easiest, straightforward, and efficient way to import multiple excel workbook into SAS. This technique has no restriction on the number of sheets you can import. The most interesting part is you only have to write a few lines of code (less than 10 lines, for the most part). ; ...
HOW TO IMPORT MULTIPLE EXCEL SHEETS INTO SAS
Просмотров 9 тыс.5 лет назад
Watch this video if you want to import multiple excel sheets into SAS. While it's relatively easier to import a single sheet, the import process gets a little more complicated with many excel sheets containing data sets you want to send to SAS. This tutorial demonstrates one of the many ways to import data from multiple excel sheets into SAS using the SAS' MACRO facility. Here is the code to ac...
Best Practice in Excel for SAS
Просмотров 1015 лет назад
Planning to import your data into SAS from an excel file, please watch this video. Remember SAS naming convention when naming your variables and sheets in excel. SAS catches what you don't see. So, it makes your life easier down the line. ruclips.net/video/ULez2CuSnPk/видео.html
SAS: IMPORT DATA FROM A CSV File #1
Просмотров 1,1 тыс.5 лет назад
This video explains how to import data from a CSV file into SAS. The steps to do this are clear and easy to follow. * ; dm'log;clear;output;clear;odsresults;clear'; %Let dir = E:\SAS_tutorials\; * DATA IMPORT FROM CSV FILE ; PROC IMPORT DATAFILE="&dir.iris.csv" DBMS=CSV OUT=iris REPLACE; RUN; * Let's look at the top 5 observations of our data; PROC PRINT data=iris (obs=5);RUN; * A little more i...
SAS: HOW TO IMPORT EXCEL WORKSHEET
Просмотров 1,9 тыс.5 лет назад
This video explains how to import excel worksheet into SAS. The steps to do this are clear and easy to follow. * ; dm'log;clear; output;clear; odsresults;clear'; %Let dir = E:\SAS_tutorials\; %Let data_in = athlete_events; * DATA IMPORT FROM EXCEL WORKSHEET ; PROC IMPORT /* PROC=procedure. PROC IMPORT = Procedure Import */ DATAFILE="&dir.&data_in" /* Source of the data to be imported */ DBMS=xl...
SAS INTRODUCTION - GET SAS FOR FREE!
Просмотров 1125 лет назад
SAS (sas.com) has been generous to provide a free copy of SAS for use by anyone. Here I demonstrate how to download and run your first code in your copy of SAS. Link to download a copy of SAS for free: www.sas.com/en_us/software/university-edition/download-software.html#windows-download STEPS I: a. Create a SAS profile if you are a new user. b. Activate your profile in an email sent to you c. C...
SAS INTRO - SYNTAX RULES
Просмотров 1585 лет назад
The video shows you (with examples) the various rules that guide your interaction with SAS. It is very important (and I can't stress this enough) to remember these rules for a great experience with SAS. Here is what we talked about in this tutorial: *SAS SYNTAX RULES; /* 1. End every SAS 'sentence' must end with a semicolon (;) 2. Don't start SAS name with a number 3. Don't start SAS name with ...
SAS Introduction - #1
Просмотров 1255 лет назад
The video introduces you to the wonderful world of the SAS programming language. This is meant to be comprehensive tutorials in SAS - from the easy through the intermediate to the hard. So, you do not require any experience in SAS to start here. Just take the plunge in SAS. Yes, just do it. While I am very excited to share this information, I am also very keen on learning new thing in SAS. So, ...

Комментарии

  • @samuelTTekle
    @samuelTTekle Год назад

    The problem is when you have 1000 sheets.

  • @jignashasoni2129
    @jignashasoni2129 Год назад

    listen to him in 10x speed. he is too lslow

  • @mohanakreddy
    @mohanakreddy 3 года назад

    Thank you so much for the logic.it really helped me get through a complex requirement

  • @Mgilsy
    @Mgilsy 3 года назад

    What a great video. Thank you, sir.

  • @kzu8976
    @kzu8976 3 года назад

    your input parameter can be a list. then %scan them to retrieve each list element (sheet name), instead of calling your macro 4 times

    • @gerrabosco4034
      @gerrabosco4034 3 года назад

      Could you please explain? Is there also a way to then put the sheet names into a column? Thank you!

    • @kzu8976
      @kzu8976 3 года назад

      @@gerrabosco4034 I was talking about a simple loop.something like this : (pseudo code, for different files. for sheet names, you can change the proc import part ) %macro customizedimport(filelist); let num = 1; filename = %scan(filelist, num); proc sql; (create a table that will contain all input file names) create table filenames as ...... quit; %do %while(&filename ne ) 1. proc import datafile = filename out= out&num ...... (output imported excel dataset to out1, out2 etc.) 2. proc sql; ( append filename into the table "filenames"); num = %eval(num + 1); filename = %scan(filelist, num); %end; %mend then you can call it like this: %customizedimport( %str( filename1 filename2 filename3));

  • @wilddoge2737
    @wilddoge2737 4 года назад

    Hi! Do you know a trick to import two or more SAS tables in a single excel sheet?

  • @tc_okolo
    @tc_okolo 5 лет назад

    Great video bro.

  • @난바로키스해요-d3d
    @난바로키스해요-d3d 5 лет назад

    thank you so much!!! really helpful