Monday 6 June 2016

How PROC SQL is unique and different from most other SAS procedures? : Epoch Research Institute India Pvt. Ltd. (www.epoch.co.in)

How PROC SQL is unique and different from most other SAS procedures? : EpochResearch Institute India Pvt Ltd. (SASAuthorised Training : Ahmedabad | Bangalore)

SAS_PROC_SQL

Sometimes you might be wondering that how PROC SQL is unique and different from other SAS procedures. So here is a stop to your question. I will let you know the basics of PROC SQL and how it differs from other SAS procedures.

PROC SQL is the SAS execution of Structured Query language. SQL is the standardized language that is most probably used to retrieve data and update data in tables. PROC SQL can be used as an unconventional and alternative to other SAS procedures or the DATA step. Following is the list and functioning of PROC SQL. You can use PROC SQL for the following reasons:

  •      Retrieving data and manipulate SAS tables
  •      Modifying data values/adding data values in table
  •      Drop columns in table
  •      Creating tables and views
  •      Generating reports and join multiple tables
PROC SQL allows you to combine data from two different external databases/external databases and SAS data set and presenting them in a single table. You can view it below:

Now next let’s drift to how SQL is unique and differ from other SAS procedures

There are numerous ways in which PROC SQL differs:
  •      Many statements in PROC SQL are composed of clauses. Let’s take an example to assist you better. The PROC SQL statement mentioned below consists of two statements i.e. PROC SQL statement and SELECT statement. Further the select statement is composed of various clauses such as SELECT, ORDER BY, WHERE and FROM
        proc sql;
        select empid,jobcode,salary,
        salary*.06 as bonus
        from sasuser.payrollmaster
        where salary<32000
        order by jobcode;

  •      PROC SQL executes each query automatically. It does not require RUN statement. If say, you use the RUN statement with PROC SQL, SAS ignores the RUN statement. But it executes the statement asusual and make a note. It is shown below
        SAS Log
       1884 proc sql;
       1885 select empid,jobcode,salary,
       1886 salary*.06 as bonus
       1887 from sasuser.payrollmaster
       1888 where salary<32000
       1889 order by jobcode;
       1890 run;
       NOTE: PROC SQL statements are executed immediately;
       The RUN statement has no effect.

  •    PROC SQL carry on and run after you submit a step. So in order to end this statement, you need to submit another PROC step, or a QUIT statement. The example is mentioned below:
      proc sql;
      select empid,jobcode,salary,
      salary*.06 as bonus
      from sasuser.payrollmaster
      where salary<32000
      order by jobcode;
      quit;

Note: SAS enterprise guide automatically inserts a QUIT statement to code when it is submitted to SAS. But still precaution should be taken and you be habituated to add the QUIT statement to the code.

So this was all from my side regarding PROC SQL. I would always encourage the views and responses from your side..

Epoch Research Institute Links:

Email us: info@epoch.co.in

SAS Training & Placement Programs with Internship: Epoch Research Institute India Largest and Oldest #SASTraining Institute (#epochsastraining)

EPOCH RESEARCH INSTITUTE OFFERS:
Authorized SAS TRAINING | SAS CERTIFICATION | SOFTWARE PURCHASE | BUINESS CONSULTING | TECHNICAL SUPPORT ON SAS || SAS STAFFING SOLUTION 

Label:
#SASELEARNING,#SASELEARNING,#SASONLINETRAINING,
#SASONLINETRAININGFORBEGINNERS,#LEARNSASPROGRAMMINGONLINE,
#SASCLINICALONLINETRAINING,#SASBASEONLINETRAINING
#BIGDATASASTRAININGEPOCH,#SASBIGDATATRAINING #EPOCHRESEARCHINSTITUTE,#SASTRAINING,#EPOCHSAS FEEDBACK,#CLINICALSAS,#CLINICALSASPROGRAMMING, #CLINICALSASPROGRAMMER

No comments:

Post a Comment

How to code in Python with SAS 9.4 by Epoch Research Institute

The SAS® platform is now open to be accessed from open-source clients such as Python, Lua, Java, the R language, and REST APIs to leverage...