Welcome to Top 10 SAS Functions
|
|
- Charlene Carson
- 5 years ago
- Views:
Transcription
1 Welcome to Top 10 SAS Functions
2 Goal and Agenda By the end of this meeting, you will understand 10 key SAS functions purpose, value and features. What are SAS functions? Why use them? Use Case Manipulating character data Working with dates (derive durations) Summarizing and rounding numeric data
3 SAS functions conduct a wealth of data manipulation operations so you can transform raw data into intelligence and insight. Categories of functions Character Currency Financial Trigonometric Descriptive statistics Date/time/temporal What to remember Why? Prepare data for reporting and analytics enhance / combine / convert data for reporting and analytics
4 What are SAS Functions? Why use SAS Functions? What? SAS functions perform computations, data manipulation, and enhancement Character Numeric Dates/temporal Mathematics Why? You need to transform raw/operational data into report- and analytics-ready structures DATA step programming SQL
5 Why these 10? What are the top 10 functions? 2017 surveys of SAS technical support (what customers submit most often) a 2016 survey on communities.sas.com Other trusted sources Which 10? character manipulation (SUBSTR, SCAN, CATX, FIND) temporal / date / time (DATEPART, DATEDIF) data conversion (PUT, INPUT) numeric (SUM, ROUND)
6 Where to find SAS Functions 1 of 2
7 Where to find SAS Functions 2 of 2
8 Use Case Raw data before functions The human resources team at a fictitious organization needs to know more about its divisions employees. employee attrition tenure total compensation
9 Use Case intelligence after using functions 1 of 2 Without formats
10 Use Case intelligence after using functions 2 of 2 With formats as shown in the PROC PRINT proc print; format newterm newhire date9. totalcomp dollar15.; run;
11 About the use case data - 1 of 2 IDNO is stored as a numeric value. The last digit of IDNO represents a division within the company. HIREDATE is a SAS datetime value. TERMDATE is a character value.
12 About the use case data - 2 of 2 Here are the attributes of the data:
13 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
14 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division a) Since IDNO is stored as numeric, it must be converted to character via the PUT function. b) Once IDNO becomes character data, its last character can be extracted via the SUBSTR function.
15 PUT (source, format) PUT Syntax converts the expression to a character string - always returns a character value source argument can be character or numeric. format contains the SAS format that you want applied to the variable or constant that is specified in the source. To override the default alignment, you can add an alignment specification to a format: L left aligns the value. C centers the value. R right aligns the value.
16 Convert Numeric to Character PUT function 1. Extract the last character of IDNO in order to identify the division a) Since IDNO is stored as numeric, it must be converted to character via the PUT function. idnoc = put(idno, 4.);
17 Extract from a Character String SUBSTR function 1. Extract the last character of IDNO in order to identify the division b) Once IDNO becomes character data, its last character can be extracted via the SUBSTR function.
18 SUBSTR Syntax Extracts a substring from an argument - returns the characters from start to end SUBSTR (string, position<, length>) string specifies any SAS character expression. position specifies a numeric expression that is the beginning character position. length specifies a numeric expression that is the length of the substring to extract. If you omit length, SAS extracts the remainder of the expression.
19 Extract from a Character String divid = substr (idnoc,4,1);
20 Excerpted DATA Step Code Step 1-Extract Division Number and Create Division Name data newinfo; set info; idnoc=put(idno, 4.); divid=substr(idnoc,4,1); length divname $ 25; if divid='1' then divname='best Gadget Toys'; else if divid='2' then divname='best Gadget Tools'; else if divid='3' then divname='best Gadget Appliances'; run;
21 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
22 How to transform the raw data into intelligence? 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable). a) Use the SCAN function to separate the values into and LASTNAME and FIRSTNAME. b) Connect LASTNAME and FIRSTNAME back together in the form FIRSTNAME LASTNAME using the CATX function.
23 SCAN Syntax Selects a given word from a character expression SCAN (string,n<, delimiter(s)>) string specifies any character expression. n specifies a numeric expression that produces the number of the word in the character string you want SCAN to select. delimiter specifies a character expression that produces characters that you want SCAN to use as a word separator in the character string.
24 Extract and separate last name and first name SCAN function 2a) Use the SCAN function to separate the values into LASTNAME and FIRSTNAME. lname = scan(name,1,', '); fname = scan(name,2,', ');
25 CATX Syntax Concatenates character strings, removes leading and trailing blanks, and inserts separators CATX (separator, string-1 <,...string-n>) separator specifies a character string that is used as a separator between concatenated strings. string specifies a SAS character string. The CATX function returns a value to a variable, or returns a value in a temporary buffer.
26 Re-arrange as first name last name CATX function 2b) Connect LASTNAME and FIRSTNAME back together in the form FIRSTNAME LASTNAME using the CATX function.. newname = catx(' ',fname,lname);
27 data newinfo; set info; idnoc=put(idno, 4.); divid=substr(idnoc,4,1); Excerpted DATA Step Code Step 2 - Create New Name length divname $ 25; if divid='1' then divname='best Gadget Toys'; else if divid='2' then divname='best Gadget Tools'; else if divid='3' then divname='best Gadget Appliances'; lname=scan(name,1,', '); fname=scan(name,2,', '); newname=catx(' ',fname,lname); run;
28 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
29 How to transform the raw data into intelligence? 3. Search for misspelled name Use the FIND function to identify a misspelled name and write a message to the SAS log. Make note of the misspelling in the SAS log
30 FIND Searches for a specific substring of characters within a character string that you specify FIND (string,substring<,modifiers>) string specifies a character constant, variable, or expression that will be searched for substrings. substring is a character constant, variable, or expression that specifies the substring of characters to search for in string. Modifiers is a character constant, variable, or expression that specifies one or more modifiers. The following modifiers can be in uppercase or lowercase: I ignores character case during the search. If this modifier is not specified, FIND only searches for character substrings with the same case as the characters in substring. Tip: Enclose a literal string of characters in quotation marks.
31 Search for misspelled name FIND function if find(newname, 'Lau', 'i') > 0 then put 'value found ' newname; Partial SAS Log
32 data newinfo; set info; idnoc=put(idno, 4.); divid=substr(idnoc,4,1); Excerpted DATA Step Code Step 3 - Find Misspelled Name length divname $ 25; if divid='1' then divname='best Gadget Toys'; else if divid='2' then divname='best Gadget Tools'; else if divid='3' then divname='best Gadget Appliances'; lname=scan(name,1,', '); fname=scan(name,2,', '); newname=catx(' ',fname,lname); if find(newname, 'Lau', 'i')>0 then put 'value found ' newname; run;
33 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
34 How to transform the raw data into intelligence? 4) Determine the number of days (years) between HIREDATE and TERMDATE a) Extract the SAS date portion of HIREDATE using the DATEPART function b) Convert TERMDATE to a SAS date using the INPUT function c) Calculate the number of days (years) between the 2 new hire and termination dates
35 What are SAS date, time and datetime values? SAS stores date values as numeric SAS date value a value that represents the number of days between January 1, 1960, and a specified date. SAS time value a value representing the number of seconds since midnight of the current day. SAS time values are between 0 and SAS datetime value a value representing the number of seconds between January 1, 1960 and an hour/minute/second within a specified date.
36 SAS Date Values SAS stores date values as numeric 01JAN JAN JAN1961 store display 01/01/ /01/ /01/1961
37 SAS Date Values 01Jan1960 Valid from 1582 A.D. to A.D. Many formats available for grouping/reporting 0 Date. 12OCT17 Date9. 12OCT2017 Worddate. October 12, 2017 Weekdate. Thursday, October 12, 2017 Month. 10 Monname. October Monname3. Oct monyy7. OCT2017
38 SAS Datetime Values SAS stores datetime values as numeric values 01JAN59:00:00:00 01JAN60:00:00:00 01JAN61:00:00:00 store display 01JAN59:12:00:00 AM 01JAN60:12:00:00 AM 01JAN61:12:00:00 AM A SAS datetime value is the number of seconds between January 1, 1960 and an hour/minute/second within a specified date.
39 Extracts the date from a SAS datetime value DATEPART DATEPART (datetime) datetime specifies a SAS expression that represents a SAS datetime value.
40 Extract the date portion of hire date DATEPART function 4a) Extract the SAS date portion of HIREDATE using the DATEPART function newhire = datepart(hiredate); New SAS Date Value New SAS Date Value with Format
41 Convert termination date portion to a SAS date INPUT function 4b) Convert TERMDATE to a SAS date using the INPUT function New SAS Date Value New SAS Date Value with Format
42 INPUT Syntax INPUT (character-expression, informat) Converts a string expression using the specified informat Often used to convert character to numeric
43 Convert termination date portion to a SAS date INPUT function 4b) Convert TERMDATE to a SAS date using the INPUT function newterm = input(termdate,date9.); New SAS Date Value New SAS Date Value with Format
44 Calculate the number of days between the hire and termination dates DATDIF function 4c) Calculate the number of days (years) between the 2 new hire and termination dates minus
45 DATDIF Syntax Returns the number of days between two dates DATDIF (sdate,edate,basis) sdate specifies a SAS date value that identifies the starting date. edate specifies a SAS date value that identifies the ending date. basis identifies a character constant or variable that describes how SAS calculates the date difference. 30/360 or 360 specifies a 30 day month and a 360 day year. ACT/ACT or Actual uses the actual number of days between dates.
46 Calculate the number of days (years) between the 2 new hire and termination dates DATDIF Now that both dates are in the form of a SAS date value, we can find the difference between the 2 dates using the DATEDIF function: if newterm ne. then do; dayofserv=datdif(newhire,newterm, 'ACT/ACT'); yearofserv= yrdif(newhire, newterm, 'ACT/ACT'); end; DATDIF
47 data newinfo;... Excerpted DATA Step Code Step 4 Derive Years (Days) of Service newterm=input(termdate,date9.); newhire=datepart(hiredate); if newterm ne. then do; dayofserv=datdif(newhire,newterm, 'ACT/ACT'); yearofserv= yrdif(newhire, newterm, 'ACT/ACT'); end; run;
48 How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division. 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
49 How to transform the raw data into intelligence? 5. Calculate the total compensation by adding SALARY, BONUS and MERIT together. a) The SUM function will add up the nonmissing values. b) The ROUND function will express the total compensation as a whole number without decimal positions.
50 SUM Syntax SUM (argument1, argument2,...) Argument(s) are numeric. The argument list can consist of a variable list, which can be preceded by OF. If all the arguments have missing values, the result is a missing value. x1=sum (4,9,3,8); 24 x2=sum (4,9,3,8,.); 24
51 Calculate Total Compensation SUM Function 5a) Calculate the total compensation by adding SALARY, BONUS and MERIT together. totalcomp = sum(salary, bonus, merit);
52 Calculate Total Compensation ROUND Function 5b) The ROUND function will express the total compensation as a whole number without decimal positions.
53 ROUND Syntax Rounds the first argument to the nearest multiple of the second argument, or to the nearest integer when the second argument is omitted ROUND (argument <,rounding-unit>) argument is a numeric constant, variable, or expression to be rounded. rounding-unit is a positive, numeric constant, variable, or expression that specifies the rounding unit.
54 Calculate Total Compensation ROUND Function 5b) The ROUND function will express the total compensation as a whole number without decimal positions. totalcomp = round(totalcomp);
55 data newinfo;... newterm=input(termdate,date9.); newhire=datepart(hiredate); Excerpted DATA Step Code Step 5 - Calculate Total Compensation if newterm ne. then do; dayofserv=datdif(newhire,newterm, 'ACT/ACT'); yearofserv= yrdif(newhire, newterm, 'ACT/ACT'); end; totalcomp=sum(salary, bonus, merit); totalcomp=round(totalcomp); run;
56 Review Raw data before functions The human resources team at a fictitious organization needs to know more about its divisions employees. employee attrition tenure total compensation
57 Review intelligence after using functions 1 of 2 Without formats
58 Review intelligence after using functions 2 of 2 With formats as shown in the PROC PRINT proc print; format newterm newhire date9. totalcomp dollar15.; run;
59 Review - How to transform the raw data into intelligence? 1. Extract the last character of IDNO in order to identify the division 2. Separate the name values into LASTNAME and FIRSTNAME, then combine them together as FIRSTNAME LASTNAME (one new variable) 3. Search for misspelled name 4. Determine the number of days (years) between HIREDATE and TERMDATE 5. Calculate total compensation
60 Final Data Step Code 1 of 2 data newinfo(drop=idno name lname fname salary bonus merit hiredate termdate); set info; idnoc=put(idno, 4.); divid=substr(idnoc,4,1); length divname $ 25; if divid='1' then divname='best Gadget Toys'; else if divid='2' then divname='best Gadget Tools'; else if divid='3' then divname='best Gadget Appliances'; lname=scan(name,1,', '); fname=scan(name,2,', '); newname=catx(' ',fname,lname); if find(newname, 'Lau', 'i')>0 then put 'value found ' newname;
61 newterm=input(termdate,date9.); newhire=datepart(hiredate); Final Data Step Code 2 of 2 if newterm ne. then do; dayofserv=datdif(newhire,newterm, 'ACT/ACT'); yearofserv= yrdif(newhire, newterm, 'ACT/ACT'); end; totalcomp=sum(salary, bonus, merit); totalcomp=round(totalcomp); run;
62 SAS functions conduct a wealth of data manipulation operations so you can transform raw data into intelligence and insight. Categories of functions Character Currency Financial Trigonometric Descriptive statistics Date/time/temporal What to remember Why? Prepare data for reporting and analytics enhance / combine / convert data for reporting and analytics
63 Hungry for more? Recommended Resources Papers Training SAS Programming 2: Data Manipulation Techniques Connect Community Blog Books and Documentation x0an0z2dzozh2ouzm.htm
Top 10 SAS Functions in A brief summary of SAS Communities Survey - by Flora Fang Liu
Top 10 SAS Functions in 2017 A brief summary of SAS Communities Survey - by Flora Fang Liu 1 What are SAS Functions? Why use SAS Functions? What? SAS functions perform computations, data manipulation,
More informationSAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapters 9, 11 & 12. By Tasha Chapman, Oregon Health Authority
SAS 101 Based on Learning SAS by Example: A Programmer s Guide Chapters 9, 11 & 12 By Tasha Chapman, Oregon Health Authority Topics covered SAS dates Date functions Numeric functions Character functions
More informationThe data step allows for creation, assembly and modification of SAS data sets.
The data step allows for creation, assembly and modification of SAS data sets. Sources of information include existing SAS data sets, database files, spreadsheets and other raw data files. Like a procedure,
More informationGIFT Department of Computing Science. [Spring 2016] CS-217: Database Systems. Lab-3 Manual. Single Row Functions in SQL
GIFT Department of Computing Science [Spring 2016] CS-217: Database Systems Lab-3 Manual Single Row Functions in SQL V3.0 4/26/2016 Introduction to Lab-3 Functions make the basic query block more powerful,
More informationDatabase Programming with SQL 5-1 Conversion Functions. Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Database Programming with SQL 5-1 Objectives This lesson covers the following objectives: Provide an example of an explicit data-type conversion and an implicit data-type conversion Explain why it is important,
More informationGIFT Department of Computing Science Data Selection and Filtering using the SELECT Statement
GIFT Department of Computing Science [Spring 2013] CS-217: Database Systems Lab-2 Manual Data Selection and Filtering using the SELECT Statement V1.0 4/12/2016 Introduction to Lab-2 This lab reinforces
More informationConversion Functions
Conversion Functions Data type conversion Implicit data type conversion Explicit data type conversion 3-1 Implicit Data Type Conversion For assignments, the Oracle server can automatically convert the
More informationAccessing Data and Creating Data Structures. SAS Global Certification Webinar Series
Accessing Data and Creating Data Structures SAS Global Certification Webinar Series Accessing Data and Creating Data Structures Becky Gray Certification Exam Developer SAS Global Certification Michele
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2009, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
More informationC How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.
C How to Program, 6/e 1992-2010 by Pearson Education, Inc. An important part of the solution to any problem is the presentation of the results. In this chapter, we discuss in depth the formatting features
More informationMANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 3 Professional Program: Data Administration and Management MANAGING DATA(BASES) USING SQL (NON-PROCEDURAL SQL, X401.9) AGENDA
More informationAssoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.
Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All rights reserved. Java application A computer program that executes when you use the java command to launch the Java Virtual Machine
More information12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.
Java How to Program, 9/e Education, Inc. All Rights Reserved. } Java application programming } Use tools from the JDK to compile and run programs. } Videos at www.deitel.com/books/jhtp9/ Help you get started
More informationINTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS
TO SAS NEED FOR SAS WHO USES SAS WHAT IS SAS? OVERVIEW OF BASE SAS SOFTWARE DATA MANAGEMENT FACILITY STRUCTURE OF SAS DATASET SAS PROGRAM PROGRAMMING LANGUAGE ELEMENTS OF THE SAS LANGUAGE RULES FOR SAS
More informationNone of the techniques used till now allows display of data from a after some arithmetic has been done it. Computations may include displaying
None of the techniques used till now allows display of data from a after some arithmetic has been done it. Computations may include displaying employee salary from the Employee_Master table along with
More informationChapter 1 The DATA Step
Chapter 1 The DATA Step 1.1 Structure of SAS Programs...1-3 1.2 SAS Data Sets... 1-12 1.3 Creating a Permanent SAS Data Set... 1-18 1.4 Writing a SAS DATA Step... 1-24 1.5 Creating a DATA Step View...
More informationUnit 6. Scalar Functions
Unit 6. Scalar Functions What This Unit Is About This unit provides information on how to use various common scalar functions. What You Should Be Able to Do After completing this unit, you should be able
More informationObjectives Reading SAS Data Sets and Creating Variables Reading a SAS Data Set Reading a SAS Data Set onboard ia.dfwlax FirstClass Economy
Reading SAS Data Sets and Creating Variables Objectives Create a SAS data set using another SAS data set as input. Create SAS variables. Use operators and SAS functions to manipulate data values. Control
More informationWKn Chapter. Note to UNIX and OS/390 Users. Import/Export Facility CHAPTER 9
117 CHAPTER 9 WKn Chapter Note to UNIX and OS/390 Users 117 Import/Export Facility 117 Understanding WKn Essentials 118 WKn Files 118 WKn File Naming Conventions 120 WKn Data Types 120 How the SAS System
More informationIT 374 C# and Applications/ IT695 C# Data Structures
IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation
More informationGetting Your Data into SAS The Basics. Math 3210 Dr. Zeng Department of Mathematics California State University, Bakersfield
Getting Your Data into SAS The Basics Math 3210 Dr. Zeng Department of Mathematics California State University, Bakersfield Outline Getting data into SAS -Entering data directly into SAS -Creating SAS
More informationDSCI 325: Handout 6 More on Manipulating Data in SAS Spring 2017
DSCI 325: Handout 6 More on Manipulating Data in SAS Spring 2017 CREATING VARIABLES IN SAS: A WRAP-UP As you have already seen several times, SAS variables can be created with an assignment statement in
More informationMIS 5208 L5 ACL: Working with Expressions
MIS 5208 L5 ACL: Working with Expressions Audit Command Language Fundamentals Ed Ferrara, MSIA, CISSP eferrara@temple.edu Working with Expressions Expressions are statements used primarily to create filters
More informationUnit 4. Scalar Functions and Arithmetic
Unit 4. Scalar Functions and Arithmetic What This Unit Is About Scalar functions can be used to manipulate column or expression values. This unit will discuss the format and syntax of basic scalar functions.
More informationSQL. - single row functions - Database Design ( 데이터베이스설계 ) JUNG, Ki-Hyun ( 정기현 )
SQL Database Design ( 데이터베이스설계 ) - single row functions - JUNG, Ki-Hyun ( 정기현 ) 1 SQL Functions Input Function Output Function performs action that defined already before execution 2 Two Types of SQL Functions
More informationC++ PROGRAMMING. For Industrial And Electrical Engineering Instructor: Ruba A. Salamh
C++ PROGRAMMING For Industrial And Electrical Engineering Instructor: Ruba A. Salamh CHAPTER TWO: Fundamental Data Types Chapter Goals In this chapter, you will learn how to work with numbers and text,
More informationITEC212 Database Management Systems Laboratory 2
ITEC212 Database Management Systems Laboratory 2 Aim: To learn how to use Single Row Functions and other important functions. In this handout we will learn about the single row functions that are used
More informationDatabase Programming with SQL
Database Programming with SQL 2-1 Objectives This lesson covers the following objectives: Apply the concatenation operator to link columns to other columns, arithmetic expressions, or constant values to
More information18. Reading date and )me values. GIORGIO RUSSOLILLO - Cours de prépara)on à la cer)fica)on SAS «Base Programming» 394
18. Reading date and )me values 394 How SAS stores date values - A SAS date value is stored as the number of days from January 1, 1960, to the given date - A SAS Bme value is stored as the number of seconds
More informationGetting Information from a Table
ch02.fm Page 45 Wednesday, April 14, 1999 2:44 PM Chapter 2 Getting Information from a Table This chapter explains the basic technique of getting the information you want from a table when you do not want
More information1. What type of error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d.
Gaddis: Starting Out with Python, 2e - Test Bank Chapter Two MULTIPLE CHOICE 1. What type of error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical
More informationReporting Functions & Operators
Functions Reporting Functions & Operators List of Built-in Field Functions Function Average Count Count Distinct Maximum Minimum Sum Sum Distinct Return the average of all values within the field. Return
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
More informationMS EXCEL: TABLES, FORMATS, FUNCTIONS AND MACROS
MS EXCEL: TABLES, FORMATS, FUNCTIONS AND MACROS ü Open the file Task_1_Template.xlsx. All the further tasks will be conducted in this file, on particular sheets (Menu, Task 1, Task 2, Task 3). TASK 1.
More informationDBLOAD Procedure Reference
131 CHAPTER 10 DBLOAD Procedure Reference Introduction 131 Naming Limits in the DBLOAD Procedure 131 Case Sensitivity in the DBLOAD Procedure 132 DBLOAD Procedure 132 133 PROC DBLOAD Statement Options
More informationMARK CARPENTER, Ph.D.
MARK CARPENTER, Ph.D. Module 5 : SAS Functions Introduction to SAS Programming and Applications Descrip(on. In this module, we with various SAS Func7ons, including numerical func7ons, date func7ons and
More informationSAS Online Training: Course contents: Agenda:
SAS Online Training: Course contents: Agenda: (1) Base SAS (6) Clinical SAS Online Training with Real time Projects (2) Advance SAS (7) Financial SAS Training Real time Projects (3) SQL (8) CV preparation
More informationCreation of SAS Dataset
Creation of SAS Dataset Contents SAS data step Access to PC files Access to Oracle Access to SQL 2 SAS Data Step Contents Creating SAS data sets from raw data Creating and managing variables 3 Creating
More informationProgramming for Engineers Introduction to C
Programming for Engineers Introduction to C ICEN 200 Spring 2018 Prof. Dola Saha 1 Simple Program 2 Comments // Fig. 2.1: fig02_01.c // A first program in C begin with //, indicating that these two lines
More informationLanguage Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */
Overview Language Basics This chapter describes the basic elements of Rexx. It discusses the simple components that make up the language. These include script structure, elements of the language, operators,
More informationBEGINNING PROBLEM-SOLVING CONCEPTS FOR THE COMPUTER. Chapter 2
1 BEGINNING PROBLEM-SOLVING CONCEPTS FOR THE COMPUTER Chapter 2 2 3 Types of Problems that can be solved on computers : Computational problems involving some kind of mathematical processing Logical Problems
More informationDatabase Programming with SQL
Database Programming with SQL 4-3 Objectives This lesson covers the following objectives: Demonstrate the use of SYSDATE and date functions State the implications for world businesses to be able to easily
More informationSAS Certification Handout #5: Ch /************ Ch. 13 ********************/ /* NOTE: Ch. 13 presents loads of functions; see pp.
SAS Certification Handout #5: Ch. 13-15 /************ Ch. 13 ********************/ /* NOTE: Ch. 13 presents loads of functions see pp. 452-455 */ /* MEAN function */ data a5 input X1-X5 Xmeans = mean(of
More informationExpressions. Definitions CHAPTER 12
131 CHAPTER 12 Expressions Definitions 131 SAS Constants in Expressions 132 Definition 132 Character Constants 132 Using Quotation Marks 132 Comparing Character Constants and Character Variables 133 Hexadecimal
More informationAll About SAS Dates. Marje Fecht Senior Partner, Prowerk Consulting. Copyright 2017 Prowerk Consulting
All About SAS Dates Marje Fecht Senior Partner, Prowerk Consulting Copyright 2017 Prowerk Consulting 1 SAS Dates What IS a SAS Date? And Why?? My data aren t stored as SAS Dates How can I convert How can
More informationEVALUATION ONLY. In this chapter, you will learn new. Text and Analysis EXCEL 2016 CHAPTER TIMING PROJECT: ANALYZING SALES INFORMATION
EXCEL 2016 3Advanced Functions for Text and Analysis In this chapter, you will learn new functions that give you greater ability for analysis and decision making. They include functions that either sum
More informationProgramming Language 2 (PL2)
Programming Language 2 (PL2) 337.1.1 - Explain rules for constructing various variable types of language 337.1.2 Identify the use of arithmetical and logical operators 337.1.3 Explain the rules of language
More informationBasic Concepts #4. Data Step #3: Reading a SAS Data Set and Functions and Call Routines. JC Wang
Basic Concepts #4 Data Step #3: Reading a SAS Data Set and Functions and Call Routines JC Wang SET Statement SET SAS-data-name; Selected data-set-options: KEEP=/DROP= to read only wanted
More informationContents. Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs
SAS Data Step Contents Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs 2 Overview Introduction This section teaches you what happens "behind
More informationAdobe EchoSign Calculated Fields Guide
Adobe EchoSign Calculated Fields Guide Version 1.0 Last Updated: May, 2013 Table of Contents Table of Contents... 2 Overview... 3 Calculated Fields Use-Cases... 3 Calculated Fields Basics... 3 Calculated
More informationProgramming Language 2 (PL2)
Programming Language 2 (PL2) 338.2.1 Explain the concept of data storage in Random files 338.2.2 Apply file manipulation functions for Random files A file opened for random access is assumed to be composed
More informationchapter 2 G ETTING I NFORMATION FROM A TABLE
chapter 2 Chapter G ETTING I NFORMATION FROM A TABLE This chapter explains the basic technique for getting the information you want from a table when you do not want to make any changes to the data and
More informationMillennium Report Writer
Millennium Report Writer The report writer can be used for most of your reporting needs, including employee and personnel listings. You also can access current, MTD, QTD, and YTD values for any earning,
More informationLanguage Fundamentals
Language Fundamentals VBA Concepts Sept. 2013 CEE 3804 Faculty Language Fundamentals 1. Statements 2. Data Types 3. Variables and Constants 4. Functions 5. Subroutines Data Types 1. Numeric Integer Long
More informationChapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics
Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional
More informationBase and Advance SAS
Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS
More informationRestricting and Sorting Data. Copyright 2004, Oracle. All rights reserved.
Restricting and Sorting Data Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the rows that are retrieved by a query Use
More information16. Reading raw data in fixed fields. GIORGIO RUSSOLILLO - Cours de prépara)on à la cer)fica)on SAS «Base Programming» 364
16. Reading raw data in fixed fields 364 Reading raw Dataset: three solu)ons You can mix all of them! Data that SAS cannot read without further informa)on 365 Reading standard data with column input: review
More informationPL / SQL Basics. Chapter 3
PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic
More informationRETRIEVING DATA USING THE SQL SELECT STATEMENT
RETRIEVING DATA USING THE SQL SELECT STATEMENT Course Objectives List the capabilities of SQL SELECT statements Execute a basic SELECT statement Development Environments for SQL Lesson Agenda Basic SELECT
More informationACCESS Procedure Reference
59 CHAPTER 5 ACCESS Procedure Reference Introduction 59 Case Sensitivity in the ACCESS Procedure 60 ACCESS Procedure 60 Description 61 PROC ACCESS Statement Options 62 Options 62 SAS System Passwords for
More informationINTRODUCTION TO MYSQL MySQL : It is an Open Source RDBMS Software that uses Structured Query Language. It is available free of cost. Key Features of MySQL : MySQL Data Types: 1. High Speed. 2. Ease of
More informationLearning the Language - V
Learning the Language - V Fundamentals We now have locations to store things so we need a way to get things into those storage locations To do that, we use assignment statements Deja Moo: The feeling that
More informationLab # 4. Data Definition Language (DDL)
Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4113: Lab # 4 Data Definition Language (DDL) Eng. Haneen El-Masry November, 2014 2 Objective To be familiar with
More informationRetrieving Data Using the SQL SELECT Statement. Copyright 2004, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Copyright 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL
More informationMIT AITI Python Software Development
MIT AITI Python Software Development PYTHON L02: In this lab we practice all that we have learned on variables (lack of types), naming conventions, numeric types and coercion, strings, booleans, operator
More informationTitle for SAS Global Forum 2014 Sample Paper
Paper 1623-2014 Title for SAS Global Forum 2014 Sample Paper Jenine Milum, Equifax Inc. ABSTRACT No matter how long you ve been programming in SAS, using and manipulating dates still seems to require effort.
More informationFull file at
Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional
More informationSELF TEST. List the Capabilities of SQL SELECT Statements
98 SELF TEST The following questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully because there might be more than one correct answer.
More informationCSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York
CSc 10200! Introduction to Computing Lecture 2-3 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 2 Problem Solving Using C++ 2 Objectives In this
More informationDepartment of Computer Science University of Cyprus. EPL342 Databases. Lab 2
Department of Computer Science University of Cyprus EPL342 Databases Lab 2 ER Modeling (Entities) in DDS Lite & Conceptual Modeling in SQL Server 2008 Panayiotis Andreou http://www.cs.ucy.ac.cy/courses/epl342
More informationUsing Custom Number Formats
APPENDIX B Using Custom Number Formats Although Excel provides a good variety of built-in number formats, you may find that none of these suits your needs. This appendix describes how to create custom
More informationContents. Generating data with DO loops Processing variables with arrays
Do-to & Array Contents Generating data with DO loops Processing variables with arrays 2 Generating Data with DO Loops Contents Introduction Constructing DO loops Do loop execution Counting do loop iterations
More informationLECTURE 02 INTRODUCTION TO C++
PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 02 INTRODUCTION
More informationproc print data=account; <insert statement here> run;
Statistics 6250 Name: Fall 2012 (print: first last ) Prof. Fan NetID #: Midterm Three Instructions: This is an in-class and open book midterm. You must write your answers on the provide spaces. Give concise
More informationDefine a method vs. calling a method. Chapter Goals. Contents 1/21/13
CHAPTER 2 Define a method vs. calling a method Line 3 defines a method called main Line 5 calls a method called println, which is defined in the Java library You will learn later how to define your own
More informationITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University
ITC213: STRUCTURED PROGRAMMING Bhaskar Shrestha National College of Computer Studies Tribhuvan University Lecture 07: Data Input and Output Readings: Chapter 4 Input /Output Operations A program needs
More informationRTL Reference 1. JVM. 2. Lexical Conventions
RTL Reference 1. JVM Record Transformation Language (RTL) runs on the JVM. Runtime support for operations on data types are all implemented in Java. This constrains the data types to be compatible to Java's
More informationDSCI 325: Handout 3 Creating and Redefining Variable in SAS Spring 2017
DSCI 325: Handout 3 Creating and Redefining Variable in SAS Spring 2017 Content Source: The Little SAS Book, Chapter 3, by L. Delwiche and S. Slaughter. CREATING NEW VARIABLES OR REDEFINING VARIABLES In
More informationBabu Madhav Institute of Information Technology, UTU 2015
Five years Integrated M.Sc.(IT)(Semester 5) Question Bank 060010502:Programming in Python Unit-1:Introduction To Python Q-1 Answer the following Questions in short. 1. Which operator is used for slicing?
More informationOutline. Data and Operations. Data Types. Integral Types
Outline Data and Operations Data Types Arithmetic Operations Strings Variables Declaration Statements Named Constant Assignment Statements Intrinsic (Built-in) Functions Data and Operations Data and Operations
More informationMicrosoft Office Excel Use Excel s functions. Tutorial 2 Working With Formulas and Functions
Microsoft Office Excel 2003 Tutorial 2 Working With Formulas and Functions 1 Use Excel s functions You can easily calculate the sum of a large number of cells by using a function. A function is a predefined,
More informationObjectives. You will learn how to process data in ABAP
Objectives You will learn how to process data in ABAP Assigning Values Resetting Values to Initial Values Numerical Operations Processing Character Strings Specifying Offset Values for Data Objects Type
More informationTutorial 2. Review CIS143
Tutorial 2 CIS143 Review Identify Components of an Excel worksheet Navigate a Worksheet Navigate Between Worksheets Plan a Worksheet Enter Data into a Worksheet Change the Size of a Row or Column Insert
More information1Z Oracle Database 11g - SQL Fundamentals I Exam Summary Syllabus Questions
1Z0-051 Oracle Database 11g - SQL Fundamentals I Exam Summary Syllabus Questions Table of Contents Introduction to 1Z0-051 Exam on Oracle Database 11g - SQL Fundamentals I 2 Oracle 1Z0-051 Certification
More informationIntroduction to SAS Statistical Package
Instructor: Introduction to SAS Statistical Package Biostatistics 140.632 Lecture 1 Lucy Meoni lmeoni@jhmi.edu Teaching Assistant : Sorina Eftim seftim@jhsph.edu Lecture/Lab: Room 3017 WEB site: www.biostat.jhsph.edu/bstcourse/bio632/default.htm
More informationHow to Read, Write, and Manipulate SAS Dates
Paper HW-063 How to Read, Write, and Manipulate SAS Dates Jenine Milum, Charlotte, NC ABSTRACT No matter how long you ve been programming in SAS, using and manipulating dates still seems to require effort.
More informationDatabase Foundations. 6-3 Data Definition Language (DDL) Copyright 2015, Oracle and/or its affiliates. All rights reserved.
Database Foundations 6-3 Roadmap You are here Introduction to Oracle Application Express Structured Query Language (SQL) Data Definition Language (DDL) Data Manipulation Language (DML) Transaction Control
More informationc) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.
2.1 Introduction (No questions.) 2.2 A Simple Program: Printing a Line of Text 2.1 Which of the following must every C program have? (a) main (b) #include (c) /* (d) 2.2 Every statement in C
More informationFundamentals of Programming Session 4
Fundamentals of Programming Session 4 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2011 These slides are created using Deitel s slides, ( 1992-2010 by Pearson Education, Inc).
More informationFull file at
Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class
More informationExcel Tips for Compensation Practitioners Weeks Text Formulae
Excel Tips for Compensation Practitioners Weeks 70-73 Text Formulae Week 70 Using Left, Mid and Right Formulae When analysing compensation data, you generally extract data from the payroll, the HR system,
More informationINTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER
INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER THE SQL PROCEDURE The SQL procedure: enables the use of SQL in SAS is part of Base SAS software follows American National Standards Institute (ANSI)
More informationIntroduction to the SAS Macro Facility
Introduction to the SAS Macro Facility Uses for SAS Macros The macro language allows for programs that are dynamic capable of selfmodification. The major components of the macro language include: Macro
More informationImelda C. Go, South Carolina Department of Education, Columbia, SC
PO 082 Rounding in SAS : Preventing Numeric Representation Problems Imelda C. Go, South Carolina Department of Education, Columbia, SC ABSTRACT As SAS programmers, we come from a variety of backgrounds.
More informationFundamentals of Programming. Lecture 3: Introduction to C Programming
Fundamentals of Programming Lecture 3: Introduction to C Programming Instructor: Fatemeh Zamani f_zamani@ce.sharif.edu Sharif University of Technology Computer Engineering Department Outline A Simple C
More informationUsing Microsoft Access
Using Microsoft Access Creating Select Queries Norm Downey Chapter 2 pages 173 193 and Chapter 3 pages 218 249 2 1 This PowerPoint uses the Sample Databases on the class website Please download them now
More informationLesson 3: Arithmetic & Casting. Pic 10A Ricardo Salazar
Lesson 3: Arithmetic & Casting Pic 10A Ricardo Salazar (2.4) Constants Sometimes we want a 'variable' that does not vary!? (OK that does not make sense... but how about a 'house' whose guest is always
More informationPython Class-Lesson1 Instructor: Yao
Python Class-Lesson1 Instructor: Yao What is Python? Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined
More informationSTATION
------------------------------STATION 1------------------------------ 1. Which of the following statements displays all user-defined macro variables in the SAS log? a) %put user=; b) %put user; c) %put
More information