This document discusses macro variables in SAS/MACROS. It covers:
1. Global and automatic macro variables that are created when SAS is invoked, as well as user-defined macro variables that can be created using %LET.
2. Referencing macro variables with an ampersand (&) to substitute their values. This works in literals enclosed in double quotes but not single quotes.
3. Automatic macro variables like SYSDATE, SYSTIME, and SYSJOBID that provide system information, and how their values can be displayed and used.
This document summarizes key concepts about macro programs in SAS including:
1) The basic structure of macro programs including defining macros with %MACRO and %MEND statements and compiling macros.
2) How macro compilation and execution works including resolving macro variables and inserting text into the input stack.
3) How to define macros with parameter lists including positional and keyword parameters and calling macros with different parameter values.
4) Tips for writing macro-based programs such as debugging with MPRINT and SYMBOLGEN options.
This document provides an overview of SAS macros, including:
1) The purpose of the SAS macro facility is to allow for dynamic and self-modifying SAS programs through the use of special programs called macros that can generate tailored SAS code.
2) There are two types of macro variables - automatic variables created by SAS and user-defined variables created within the SAS program.
3) Macro variables can be created using %LET, CALL SYMPUT, and the INTO clause and can be either global or local in scope.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
A Step-By-Step Introduction to SAS Report ProcedureYesAnalytics
The presentation of data is an essential part of every analytics project and there are number of tools within SAS that allows to create a large variety of charts, reports, and data summaries.
PROC REPORT is a particularly powerful and valuable procedure that can be used in this process. It can be used to both summarize and display data, and is highly customizable and highly flexible. It combines features of the PRINT, MEANS, and TABULATE procedures with features of the DATA step.
Here is a step by step introduction to Report Procedure which walks through the PROC REPORT statement and a few of its key options.
The document describes using conditional processing in macro programming to conditionally submit code. It discusses using %IF-%THEN statements to check conditions and only execute code within the %THEN block if the condition is true. As an example, a macro is defined to always submit a daily report, and only submit a weekly revenue report on Fridays by checking the %SYSDAY macro variable within an %IF statement.
This document provides an overview of SAS programming concepts and techniques for working with data. It discusses reading raw data using DATA steps and PROC IMPORT, selecting and transforming data, merging datasets, handling missing values, and working with dates. Functions for character manipulation, arithmetic, ranking and summarizing data are also explained. Overall, the document serves as a helpful cheat sheet for common SAS programming tasks.
This document provides a list of SAS programs covering various topics related to data management using SAS, including:
1) Reading and importing different data file types such as CSV, TAB, and delimited files;
2) Merging and concatenating datasets;
3) Converting between numeric and character values; and
4) Working with dates in SAS including calculating durations between dates.
The programs demonstrate techniques for inputting, manipulating, and outputting data in SAS using data steps and procedures like PROC PRINT and PROC IMPORT.
This document summarizes key concepts about macro programs in SAS including:
1) The basic structure of macro programs including defining macros with %MACRO and %MEND statements and compiling macros.
2) How macro compilation and execution works including resolving macro variables and inserting text into the input stack.
3) How to define macros with parameter lists including positional and keyword parameters and calling macros with different parameter values.
4) Tips for writing macro-based programs such as debugging with MPRINT and SYMBOLGEN options.
This document provides an overview of SAS macros, including:
1) The purpose of the SAS macro facility is to allow for dynamic and self-modifying SAS programs through the use of special programs called macros that can generate tailored SAS code.
2) There are two types of macro variables - automatic variables created by SAS and user-defined variables created within the SAS program.
3) Macro variables can be created using %LET, CALL SYMPUT, and the INTO clause and can be either global or local in scope.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
A Step-By-Step Introduction to SAS Report ProcedureYesAnalytics
The presentation of data is an essential part of every analytics project and there are number of tools within SAS that allows to create a large variety of charts, reports, and data summaries.
PROC REPORT is a particularly powerful and valuable procedure that can be used in this process. It can be used to both summarize and display data, and is highly customizable and highly flexible. It combines features of the PRINT, MEANS, and TABULATE procedures with features of the DATA step.
Here is a step by step introduction to Report Procedure which walks through the PROC REPORT statement and a few of its key options.
The document describes using conditional processing in macro programming to conditionally submit code. It discusses using %IF-%THEN statements to check conditions and only execute code within the %THEN block if the condition is true. As an example, a macro is defined to always submit a daily report, and only submit a weekly revenue report on Fridays by checking the %SYSDAY macro variable within an %IF statement.
This document provides an overview of SAS programming concepts and techniques for working with data. It discusses reading raw data using DATA steps and PROC IMPORT, selecting and transforming data, merging datasets, handling missing values, and working with dates. Functions for character manipulation, arithmetic, ranking and summarizing data are also explained. Overall, the document serves as a helpful cheat sheet for common SAS programming tasks.
This document provides a list of SAS programs covering various topics related to data management using SAS, including:
1) Reading and importing different data file types such as CSV, TAB, and delimited files;
2) Merging and concatenating datasets;
3) Converting between numeric and character values; and
4) Working with dates in SAS including calculating durations between dates.
The programs demonstrate techniques for inputting, manipulating, and outputting data in SAS using data steps and procedures like PROC PRINT and PROC IMPORT.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
This document provides a summary of the SAS programming language and various SAS procedures. It describes the basic structure of a SAS job, SAS language elements like statements, comments, and variables. It also summarizes how to work with SAS data sets, the DATA and PROC steps for data manipulation and analysis, and some common statistical and graphical procedures.
MySQL is an open-source relational database management system that can be installed on Linux and Windows. The document provides step-by-step instructions for installing and configuring MySQL and describes common SQL commands for creating and managing databases, tables, and data. Key MySQL features and administration tasks such as backup, restoration, user and privilege management are also overviewed.
This document summarizes the SAS functions INDEX, INDEXC, and INDEXW. It explains that these functions search for a character or substring in a string and return the position of the first occurrence from left to right as a number. INDEX searches for a specific substring. INDEXC searches for the first occurrence of any character in a list. INDEXW searches for the first occurrence of a specific word. The document provides syntax examples for each function.
This document provides examples of 40 SQL queries that can be used for testing purposes. The queries demonstrate different SQL functions and syntax for selecting, filtering, grouping, joining, and aggregating data from database tables. Some example queries show how to retrieve employee names, salaries, departments, dates and other fields from sample employee and department tables.
This document provides an overview of basic SQL concepts and functions using Oracle SQL. It covers topics such as SELECT statements, WHERE clauses, joins, functions, subqueries, and data manipulation using INSERT, UPDATE and DELETE statements. The document is a handout for a Database Management Systems course, intended to teach students the fundamentals of Oracle SQL.
This document discusses procedures and functions in PL/SQL. It defines a procedure as a group of PL/SQL statements that can be called by name and does not need to return a value. A function is similar to a procedure but must return a single value. The document provides the syntax for creating procedures and functions, and examples of standalone and recursive procedures and functions. It explains how to call procedures and functions, and the differences between them, such as procedures not having a return value while functions do.
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 SolutionVibeesh CS
1) The document demonstrates various SAS procedures to analyze and summarize data from multiple SAS data sets, including PROC MEANS, PROC FREQ, PROC TABULATE, PROC GCHART, and PROC GPLOT.
2) Examples include computing statistics by gender and school size using BY and CLASS statements in PROC MEANS, creating frequency tables and cross tabulations in PROC FREQ, producing customized tables using PROC TABULATE, and creating bar charts and scatter plots using PROC GCHART and PROC GPLOT.
3) The document also demonstrates using ODS to produce output files and control formatting and layout of results.
This document provides an introduction and overview of PL/SQL. It discusses that PL/SQL is Oracle's procedural language extension for SQL and allows for transactions processing and block structuring. The document then covers various PL/SQL concepts like blocks, data types, control structures, variables and SQL operations within PL/SQL code.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
The document discusses various data types in C++ including built-in, user-defined, and derived types. Structures and unions allow grouping of dissimilar element types. Classes define custom data types that can then be used to create objects. Enumerated types attach numeric values to named constants. Arrays define a collection of elements of the same type in sequence. Functions contain blocks of code to perform tasks. Pointers store memory addresses.
SAS is a programming language that can be learned quickly. New users can write simple SAS programs within hours. SAS programs involve DATA and PROC steps - DATA steps input and process data, while PROC steps perform operations and output. The example SAS program reads student data from cards, assigns the values to variables in a DATA step, and prints the output in a PROC PRINT step. Additional PROC SORT and formatting options are demonstrated. The log file provides feedback on program execution and errors.
The document discusses different types of conditional statements in C including if, if-else, nested if-else, if-else ladder, switch, and goto statements. It provides the syntax and explains the logic and flow of each statement. The if statement executes code if a condition is true. The if-else statement executes one block if true and another if false. Nested if-else tests multiple conditions in sequence. The if-else ladder tests conditions from top to bottom. Switch compares a value to multiple cases and executes the matching block. Goto unconditionally transfers control to a labeled statement.
Structured Query Language (SQL) is a query language that allows users to specify conditions to retrieve data from a database. SQL queries select rows from database tables that satisfy specified conditions. The results are output in a table format. Common SQL clauses include SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and INTO to output results to a table, cursor, file or printer. SQL can perform queries on single or multiple related tables through joins.
Este documento contiene ejemplos de código PL/SQL para declarar y ejecutar bloques, procedimientos y funciones. Incluye ejemplos de cómo crear y usar cursores, así como ejemplos de procedimientos que utilizan cursores para recuperar y mostrar datos de tablas.
This document provides an introduction and outline for using SAS software. It covers basic SAS windows and rules, loading and viewing data, manipulating data by selecting subsets, adding or deleting variables, sorting, summarizing data with procedures, and creating plots and outputting results to Word. Examples are provided for common procedures like SORT, MEANS, UNIVARIATE, FREQ, CORR and PLOT. Practice exercises are included to try these skills on a sample dataset.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
This document provides a summary of the SAS programming language and various SAS procedures. It describes the basic structure of a SAS job, SAS language elements like statements, comments, and variables. It also summarizes how to work with SAS data sets, the DATA and PROC steps for data manipulation and analysis, and some common statistical and graphical procedures.
MySQL is an open-source relational database management system that can be installed on Linux and Windows. The document provides step-by-step instructions for installing and configuring MySQL and describes common SQL commands for creating and managing databases, tables, and data. Key MySQL features and administration tasks such as backup, restoration, user and privilege management are also overviewed.
This document summarizes the SAS functions INDEX, INDEXC, and INDEXW. It explains that these functions search for a character or substring in a string and return the position of the first occurrence from left to right as a number. INDEX searches for a specific substring. INDEXC searches for the first occurrence of any character in a list. INDEXW searches for the first occurrence of a specific word. The document provides syntax examples for each function.
This document provides examples of 40 SQL queries that can be used for testing purposes. The queries demonstrate different SQL functions and syntax for selecting, filtering, grouping, joining, and aggregating data from database tables. Some example queries show how to retrieve employee names, salaries, departments, dates and other fields from sample employee and department tables.
This document provides an overview of basic SQL concepts and functions using Oracle SQL. It covers topics such as SELECT statements, WHERE clauses, joins, functions, subqueries, and data manipulation using INSERT, UPDATE and DELETE statements. The document is a handout for a Database Management Systems course, intended to teach students the fundamentals of Oracle SQL.
This document discusses procedures and functions in PL/SQL. It defines a procedure as a group of PL/SQL statements that can be called by name and does not need to return a value. A function is similar to a procedure but must return a single value. The document provides the syntax for creating procedures and functions, and examples of standalone and recursive procedures and functions. It explains how to call procedures and functions, and the differences between them, such as procedures not having a return value while functions do.
Learning SAS With Example by Ron Cody :Chapter 16 to Chapter 20 SolutionVibeesh CS
1) The document demonstrates various SAS procedures to analyze and summarize data from multiple SAS data sets, including PROC MEANS, PROC FREQ, PROC TABULATE, PROC GCHART, and PROC GPLOT.
2) Examples include computing statistics by gender and school size using BY and CLASS statements in PROC MEANS, creating frequency tables and cross tabulations in PROC FREQ, producing customized tables using PROC TABULATE, and creating bar charts and scatter plots using PROC GCHART and PROC GPLOT.
3) The document also demonstrates using ODS to produce output files and control formatting and layout of results.
This document provides an introduction and overview of PL/SQL. It discusses that PL/SQL is Oracle's procedural language extension for SQL and allows for transactions processing and block structuring. The document then covers various PL/SQL concepts like blocks, data types, control structures, variables and SQL operations within PL/SQL code.
This document provides an introduction to SQL (Structured Query Language). It defines SQL as a standard language for accessing and manipulating databases. The key points covered include:
- SQL lets you perform queries against a database to retrieve, insert, update, and delete data. It can also be used to create and modify database structures.
- Common SQL commands covered are SELECT, INSERT, UPDATE, DELETE, CREATE TABLE, ALTER TABLE, DROP TABLE.
- Additional SQL concepts explained are data types, WHERE clauses, ORDER BY clauses, GROUP BY clauses, and JOIN operations.
- RDBMS systems like MySQL, SQL Server, Oracle, etc. use SQL to communicate with the databases they manage.
The document discusses various data types in C++ including built-in, user-defined, and derived types. Structures and unions allow grouping of dissimilar element types. Classes define custom data types that can then be used to create objects. Enumerated types attach numeric values to named constants. Arrays define a collection of elements of the same type in sequence. Functions contain blocks of code to perform tasks. Pointers store memory addresses.
SAS is a programming language that can be learned quickly. New users can write simple SAS programs within hours. SAS programs involve DATA and PROC steps - DATA steps input and process data, while PROC steps perform operations and output. The example SAS program reads student data from cards, assigns the values to variables in a DATA step, and prints the output in a PROC PRINT step. Additional PROC SORT and formatting options are demonstrated. The log file provides feedback on program execution and errors.
The document discusses different types of conditional statements in C including if, if-else, nested if-else, if-else ladder, switch, and goto statements. It provides the syntax and explains the logic and flow of each statement. The if statement executes code if a condition is true. The if-else statement executes one block if true and another if false. Nested if-else tests multiple conditions in sequence. The if-else ladder tests conditions from top to bottom. Switch compares a value to multiple cases and executes the matching block. Goto unconditionally transfers control to a labeled statement.
Structured Query Language (SQL) is a query language that allows users to specify conditions to retrieve data from a database. SQL queries select rows from database tables that satisfy specified conditions. The results are output in a table format. Common SQL clauses include SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, and INTO to output results to a table, cursor, file or printer. SQL can perform queries on single or multiple related tables through joins.
Este documento contiene ejemplos de código PL/SQL para declarar y ejecutar bloques, procedimientos y funciones. Incluye ejemplos de cómo crear y usar cursores, así como ejemplos de procedimientos que utilizan cursores para recuperar y mostrar datos de tablas.
This document provides an introduction and outline for using SAS software. It covers basic SAS windows and rules, loading and viewing data, manipulating data by selecting subsets, adding or deleting variables, sorting, summarizing data with procedures, and creating plots and outputting results to Word. Examples are provided for common procedures like SORT, MEANS, UNIVARIATE, FREQ, CORR and PLOT. Practice exercises are included to try these skills on a sample dataset.
SQL is a standard language for accessing and manipulating databases. It allows users to retrieve, insert, update, and delete data as well as create new databases and tables. Common SQL statements include SELECT, UPDATE, DELETE, and INSERT. SQL uses clauses, operators, and wildcards to filter records based on conditions. Some key points are that SQL is an ANSI standard but different versions exist, it allows querying and modifying data in databases, and is essential for interacting with relational database systems.
This document provides a step-by-step guide to learning SAS. It begins with an introduction to SAS and its windowing environment. Next, it discusses SAS datasets and variables, including importing data into SAS and basic procedures and functions. The document then covers combining datasets in SAS before concluding with next steps. It assumes some basic database and analytics knowledge and provides disclaimers about its intended use as a high-level summary.
Applying SAS Macro to build a model for US Adult Census Income.
The purpose of this project is to practice SAS Macro skill and hit all points of the assignment.
This document provides an introduction to SAS (Statistical Analysis System) including data management and analysis. It covers general topics such as the SAS interface, programs, data libraries and help/documentation. Specific techniques are explained like importing external data, combining and subsetting datasets, and commonly used functions. The document also gives examples of SAS statements for creating and analyzing datasets.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
This document discusses different ways to create macro variables from within a DATA step in SAS. It describes using the SYMPUT routine to assign values from DATA step variables or expressions to macro variables. Multiple macro variables can be created in a single DATA step using SYMPUT with expressions for both the macro variable name and value. Indirect referencing of macro variables allows their values to be resolved at a later time.
The macro processor detects macro triggers like % and & in the code and handles macro code and variable substitution. It stores macro variables and their values in a symbol table. When it detects a macro variable reference &variable, it looks up the variable name in the symbol table and substitutes the variable value into the code before passing it to the compiler. This allows macros to generate dynamic code with variable data.
This lesson covers SAS macros including how they work, creating macros and macro variables, and incorporating macros into existing programs. Key points include macros allow writing a program that generates a program, macros help automate repetitive tasks, and macro variables store text strings that can be referenced throughout a SAS program. The lesson also reviews invoking macros, using parameters, and conditional logic with %IF/%THEN/%ELSE.
.NET library which enables minification, compression, combination, and caching of JavaScript and CSS resources for ASP.NET and ASP.NET MVC web applications. Simply put, it helps your applications rank better with YSlow and PageSpeed.
When best to use the %let statement, the symput routine, or the into clause t...Arthur8898
The document discusses different methods for creating macro variables in SAS, including the %LET statement, SYMPUT routine, and INTO clause. It explains that the %LET statement stores values as character strings and does not evaluate mathematical expressions. It also covers how SAS processing works, with statements being sent to the word scanner, tokenizer, compiler, and macro processor. The macro processor is responsible for processing macro language elements like %LET and macro variable references.
This document describes a SAS application that dynamically creates drill-down capabilities in SAS output to allow users to view listings of ID numbers associated with specific data values. The application generates one-way or two-way frequency tables with hyperlinks connecting data values to HTML pages listing corresponding ID numbers. It uses macros to dynamically identify variables, create frequency tables and matching HTML files, and add hyperlinks to data values in the output. This allows non-programmers to efficiently examine specific cases behind data values without involving programmers.
The document provides an overview of the SAS system and its components. It describes the four main data-driven tasks of data access, data management, data analysis, and data presentation. It also outlines the structure of SAS programs and data sets, and how to run and submit SAS programs. Key concepts covered include DATA and PROC steps, the SAS log and output, browsing descriptor and data portions of SAS data sets, and SAS syntax rules.
Task Perform addition subtraction division and multiplic.pdfacsmadurai
Task: Perform addition, subtraction, division, and multiplication, of rational numbers on MIPS Mars
Programming Simulator by writing a code and print the answers (using macros) from the pictures
provided. Also, when you write the code make sure you follow this format,
format:
.macro print_int (%x)
li $v0, 1
add $a0, $zero, %x
syscall
.end_macro
print_int ($s0)
print_int (10)
Intro Settings Syscalls IDE Debugging Command Tools History Limitations Exception Handlers
Macros Acknowledgements MARS home Writing and Using Macros .macro, .end_macro,.eqv and
.include directives are new in MARS 4.3 Introduction to macros Patterson and Hennessy define a
macro as a pattern-matching and replacement facility that provides a simple mechanism to name
a frequently used sequence of instructions [1]. This permits the programmer to specify the
instruction sequence by invoking the macro. This requires only one line of code for each use
instead of repeatedly typing in the instruction sequence each time. It follows the axiom "define
once, use many times," which not only reduces the chance for error but also facilitates program
maintenance. Macros are like procedures (subroutines) in this sense but operate differently than
procedures. Procedures in MIPS assembly language follow particular protocols for procedure
definition, call and return. Macros operate by substituting the macro body for each use at the time
of assembly. This substitution is called macro expansion.. They do not require the protocols and
execution overhead of procedures. As a simple example, you may want to terminate your program
from a number of locations. If you are running from the MARS IDE, you will use system call 10,
exit. The instruction sequence is pretty easy 1i$v0,10syscal1 but still tedious. You can define a
macro, let's call it done, to represent this sequence [ begin{array}{l} text { macro done } text { i1 } $
text { vo, } 10 text { syscali } text { +end_macro } end{array} ] then invoke it whenever you wish
with the statement done At assembly time, the assembler will replace each occurrence of the
statement done with the two-statement sequence 1i$v0,10syscali This is the macro expansion.
The runtime simulator is unaware of macros or macro expansion. If running MARS from the
command line, perhaps you want to return a termination value. This can be done with syscall 17,
exit2, which takes the termination value as an argument. An equivalent macro, let's call it
terminate would be macro terminate (stermination_value) ii $a0, itermination_value li $v0,17
syscali .end_macro This macro defines a formal parameter to represent the termination value. You
would invoke it with the statement terminate (1) to terminate with value 1. Upon assembly, the
statement terminate (1) would be replaced byterninate (1) to terminate with value 1. Upon
assembly, the statement terainate (1) would be replaced by the three-statement sequence The
argument value, 1, is substituted wherever the formal parameter teermi.
The document discusses macro processors and macro expansion. Some key points:
- A macro is a shorthand notation that allows a programmer to write a block of code once then invoke it multiple times by calling the macro.
- When a macro is invoked, the macro processor replaces it with the body of statements defined in the macro, substituting any arguments for parameters.
- This expands the code without analyzing the meaning of the statements, in a way that is machine independent.
- The example shows how a macro definition declares parameters with & and how expansion substitutes arguments for parameters in the body when the macro is invoked.
Learning
Base SAS,
Advanced SAS,
Proc SQl,
ODS,
SAS in financial industry,
Clinical trials,
SAS Macros,
SAS BI,
SAS on Unix,
SAS on Mainframe,
SAS interview Questions and Answers,
SAS Tips and Techniques,
SAS Resources,
SAS Certification questions...
visit http://sastechies.blogspot.com
MySQL is an open-source relational database management system that runs on a server and allows for multi-user access to databases. It is commonly used with web applications and by popular websites. MySQL uses commands like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports stored procedures and functions to organize more complex queries and calculations.
This document discusses how to call functions in the R language from SAS/IML Studio. It describes transferring data between SAS and R data structures, calling an R analysis from IMLPlus, and calling R packages and graphics from IMLPlus. Specifically, it shows how to:
1. Submit R statements from within an IMLPlus program using SUBMIT / R.
2. Transfer data between SAS data sets, matrices, and DataObjects and R data frames and matrices.
3. Call an R linear regression analysis, extract results, and transfer them back to SAS.
4. Load an R package and call functions from it to estimate a kernel density and create a histogram.
MySQL is an open-source relational database management system that runs a server providing multi-user access to databases. It is commonly used with web applications and is popular for its use with PHP. Many large websites use MySQL to store user data. MySQL supports basic queries like SELECT, INSERT, UPDATE, and DELETE to retrieve, add, modify and remove data from databases. It also supports more advanced functions and queries.
This document discusses various ways to set and check the optimizer mode in Oracle at both the parameter and session level. It also provides examples of using EXPLAIN PLAN to view execution plans for different types of queries, examples of query transformations Oracle can perform, and tips for SQL performance tuning such as using appropriate data types in comparisons and minimizing functions in joins.
Vpd Virtual Private Database By Saurabhguestd83b546
Virtual Private Database (VPD) offers lower cost of ownership, eliminates application security problems, and provides application transparency through fine-grained row-level access control. VPD works by appending predicates generated by policy functions to SQL statements before execution. These functions return strings that filter rows based on contextual information like the current user.
There are 4 types of JDBC drivers. Database connections can be obtained using the DriverManager or a DataSource. Statements are used to execute SQL queries and updates. PreparedStatements are useful for executing the same statement multiple times with different parameter values. Joins allow querying data from multiple tables.
BPC Logics allows us to perform calculations on BPC data. BPC comes with three different types of logic (1) Worksheet logic, (2) Dimension logic and (3)Advanced (Script) logic. Normally we use one or more, or all of them is our BPC environment. Usage of these scripts depends on many factors, for example (1) performance issue, (2) complexity, (3) user preferences, etc. each of these script has its own its own advantages and disadvantages. Among the logics, script logic is much loved and widely used logic. Refer the embedded slide for more information. Hope you will enjoy it. Thanks, Surya Padhi
Integrating SAP the Java EE Way - JBoss One Day talk 2012hwilming
Cuckoo is an open source Resource Adapter for SAP that is compatible to the Java Connector Architecture (JCA) version 1.5.
It enables developers of Java EE applications to call functions in a SAP backend, making use of Java EE features like Container Managed Transactions and Security.
Hibersap helps developers of Java applications to call business logic in SAP backends. It defines a set of Java annotations to map SAP function modules to Java classes as well as a small, clean API to execute these function modules and handle transaction and security aspects.
Hibersap's programming model is quite similar to those of modern O/R mappers, significantly speeding up the development of SAP interfaces and making it much more fun to write the integration code.
The document discusses extending ETL capabilities to support heterogeneous and unstructured data sources. It describes customizing code templates to enable extracting data from various sources like databases, XML/CSV files, PDF documents, HTML files, and Microsoft SharePoint using web services. Specific examples provided include customizing platforms for non-Oracle databases, integrating PDF documents using metadata interfaces, and parsing HTML tables to extract tabular data.
MySQL is a relational database management system that is open-source and can be installed from binary packages. It is commonly used for small to medium web applications and can be managed through command line tools or graphical interfaces. SQL queries are used to manage the database structure and data.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Tatiana Kojar
Skybuffer AI, built on the robust SAP Business Technology Platform (SAP BTP), is the latest and most advanced version of our AI development, reaffirming our commitment to delivering top-tier AI solutions. Skybuffer AI harnesses all the innovative capabilities of the SAP BTP in the AI domain, from Conversational AI to cutting-edge Generative AI and Retrieval-Augmented Generation (RAG). It also helps SAP customers safeguard their investments into SAP Conversational AI and ensure a seamless, one-click transition to SAP Business AI.
With Skybuffer AI, various AI models can be integrated into a single communication channel such as Microsoft Teams. This integration empowers business users with insights drawn from SAP backend systems, enterprise documents, and the expansive knowledge of Generative AI. And the best part of it is that it is all managed through our intuitive no-code Action Server interface, requiring no extensive coding knowledge and making the advanced AI accessible to more users.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
5. Global Macro Variables Whenever the SAS System is invoked, a global symbol table is created and initialized with automatic or system-defined macro variables. You can also create user-defined global macro variables with the %LET statement: %let city=Dallas; %let date=05JAN2000; %let amount=975; Automatic Variables Global Symbol Table . . . . SYSTIME 09:47 SYSVER 8.01 . . . . CITY Dallas DATE 05JAN2000 AMOUNT 975 User-defined Variables Basic Concepts
6.
7. Referencing a Macro Variable Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975 Example: Use a macro variable reference to make a substitution in a SAS program statement. where fee>&amount; generates WHERE FEE>975; Basic Concepts
8. Referencing a Macro Variable The word scanner continues to tokenize literals enclosed in double quotes, permitting macro variables to resolve. where cityst CONTAINS "&city"; generates WHERE CITYST CONTAINS "Dallas"; If you need to reference a macro variable within a literal, enclose the literal in double quotes. The word scanner does not tokenize literals enclosed in single quotes, so macro variables do not resolve. where cityst contains '&city'; generates WHERE CITYST CONTAINS '&city'; Basic Concepts Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975
9. Referencing a Macro Variable Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975 Referencing a nonexistent macro variable results in a warning message. title "Students from &cityst"; generates WARNING: Apparent symbolic reference CITYST not resolved. When the macro processor cannot act upon a macro variable reference, a message is printed in the SAS log. Basic Concepts
10. Referencing a Macro Variable Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975 Referencing an invalid macro variable name results in an error message. title "Students from &the_city_in_which_the_student_is_located"; generates ERROR: Symbolic variable name THE_CITY_IN_WHICH_THE_STUDENT_IS_LOCATED must be 32 or fewer characters long. Basic Concepts
11. Displaying Macro Variable Values Use the SYMBOLGEN system option to monitor the value that is substituted for a macro variable referenced. General form of the SYMBOLGEN system option: OPTIONS SYMBOLGEN; This system option displays the results of resolving macro variable references in the SAS log. Note: The default option setting is NOSYMBOLGEN . Basic Concepts
12. Displaying Macro Variable Values Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975 Partial SAS Log where fee>&amount; SYMBOLGEN: Macro variable AMOUNT resolves to 975 where city_state contains "&city"; SYMBOLGEN: Macro variable CITY resolves to Dallas where city_state contains ’&city’; Why is no message displayed for the final example? Basic Concepts
13. Displaying Macro Variable Values To verify the values of macro variables, you may want to write your own messages to the SAS log. The %PUT statement writes text to the SAS log. General form of the %PUT statement: %PUT text ; Basic Concepts
14.
15.
16. Example: Write a message to the SAS log to verify the value of the macro variable CITY. Global Symbol Table CITY Dallas DATE 05JAN2000 AMOUNT 975 Partial SAS Log %put The value of the macro variable CITY is: &city; The value of the macro variable CITY is: Dallas Displaying Macro Variable Values Basic Concepts
17.
18.
19.
20. Some automatic macro variables have fixed values that are set at SAS invocation: Name Value SYSDATE date of SAS invocation (DATE7.) SYSDATE9 date of SAS invocation (DATE9.) SYSDAY day of the week of SAS invocation SYSTIME time of SAS invocation SYSENV FORE (interactive execution) BACK (noninteractive or batch execution) SYSSCP abbreviation for the operating system used such as OpenVMS, WIN, HP 300 SYSVER release of SAS software being used SYSJOBID identifier of current SAS session or batch job mainframe systems:the userid or job name other systems: the process ID (PID). System-Defined Automatic Macro Variables Automatic Micro Variables
21. Some automatic macro variables have values that automatically change based on submitted SAS statements: System-Defined Automatic Macro Variables Automatic Micro Variables Name Value SYSLAST name of most recently created SAS data set in the form libref.nam e. If no data set has been created, the value is _NULL_. SYSPARM text specified at program invocation.
22. Example: Substitute system information in footnotes for a report. footnote1 "Created &systime &sysday, &sysdate9"; footnote2 "on the &sysscp system using Release &sysver"; title "REVENUES FOR DALLAS TRAINING CENTER"; proc tabulate data=perm.all(keep=location course_title fee); where upcase(location)="DALLAS"; class course_title; var fee; table course_title=" " all="TOTALS", fee=" "*(n*f=3. sum*f=dollar10.) / rts=30 box="COURSE"; run; System-Defined Automatic Macro Variables Automatic Micro Variables
24. The values of automatic macro variables can be displayed in the SAS log by specifying the _AUTOMATIC_ argument in the %PUT statement. %put _automatic_; System-Defined Automatic Macro Variables Automatic Micro Variables
25. Partial SAS Log The values of the macro variables SYSDATE, SYSDATE9, and SYSTIME are character strings , not SAS date or time values. System-Defined Automatic Macro Variables Automatic Micro Variables
26. Applications for Automatic Variables SYSDATE Check the current date to execute programs or on certain days of the month. Substitute SYSDATE9 the value in a TITLE statement. SYSDAY Check the value to run a given job on a certain day of the week. SYSENV Check the execution mode before submitting code that requires interactive(foreground) processing. Possible applications for automatic macro variables: Automatic Micro Variables
27. Applications for Automatic Variables SYSVER Check for the release of SAS software being used before executing a job with newer features. SYSJOBID Check who is currently executing the job to restrict certain processing or issue commands specific to a user . SYSERR Check the return code from a SAS procedure or DATA step and abort the job if the return code is nonzero. SYSRC Check the return code of any system command before continuing with the job. Automatic Micro Variables
28. The SYSPARM Macro Variable (Self-Study) OS/390 // EXEC SAS,OPTIONS='SYSPARM=SEATTLE' BATCH //SYSIN DD DSN= program-name,DISP=SHR TSO sas input(''' program-name''') opt('sysparm=SEATTLE') CMS sas program-name (sysparm=SEATTLE) OpenVMS sas/sysparm=SEATTLE program-name Windows sas program-name -sysparm SEATTLE UNIX Using the SYSPARM= system option to supply a value for the SYSPARM macro variable at SAS invocation. To assign the value SEATTLE to the SYSPARM macro variable, specify the SYSPARM= system option: Automatic Micro Variables
29. title "REVENUES FOR &sysparm TRAINING CENTER"; proc tabulate data=perm.all(keep=location course_title fee); where upcase(location)="&sysparm"; class course_title; var fee; table course_title=’ ’ all=’TOTALS’, fee=’ ’*(n*f=3. sum*f=dollar10.) / rts=30 box=’COURSE’; run; Example: Use one program to create a revenue report for any training center. Supply the name of the center at SAS invocation. The SYSPARM Macro Variable (Self-Study) Automatic Micro Variables
30. Output for SYSPARM Value of SEATTLE The SYSPARM Macro Variable (Self-Study) Automatic Micro Variables
31.
32.
33. The %LET Statement The %LET statement enables you to define a macro variable and assign it a value. General form of the %LET statement: %LET variable = value ; User-Defined Micro Variables
34.
35.
36. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; Value ... The %LET Statement Examples User-Defined Micro Variables
37. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; Value Ed Norton The %LET Statement Examples User-Defined Micro Variables
38. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
39. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
40. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
41. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” 0 ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
42. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” 0 3+4 ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
43. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” 0+3+4 3+4 ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
44. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” 0+3+4 3+4 varlist ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
45. Use the rules on the previous page to determine the values assigned to macro variables by these %LET statements: Value Ed Norton ’ Ed Norton ’ “ Joan’s Report” 0+3+4 3+4 varlist name age height ... %let name= Ed Norton ; %let name2=’ Ed Norton ’; %let title="Joan’s Report"; %let start=; %let total=0; %let sum=3+4; %let total=&total+∑ %let x=varlist; %let &x=name age height; The %LET Statement Examples User-Defined Micro Variables
46. Example: Assign the value DALLAS to the macro variable SITE. Use the macro variable to control program output. %let site=DALLAS; title "REVENUES FOR &site TRAINING CENTER"; proc tabulate data=perm.all(keep=location course_title fee); where upcase(location)="&site"; class course_title; var fee; table course_title=’ ’ all=’TOTALS’, fee=’ ’*(n*f=3. sum*f=dollar10.) / rts=30 box=’COURSE’; run; The %LET Statement Examples User-Defined Micro Variables
48. Displaying User-defined Macro Variables The values of user-defined macro variables can be displayed in the SAS log by specifying the _USER_ argument in the %PUT statement. %let city=Dallas; %let date=22MAY95; %let amount=795; %put _user_; continued... User-Defined Micro Variables
49. Note: The statement %put _all_; displays both automatic and user-defined macro variables. Partial SAS Log Displaying User-defined Macro Variables User-Defined Micro Variables
53. Many macro applications require character string manipulation. Selected macro character functions: %UPCASE translates letters from lowercase to uppercase. %SUBSTR produces a substring of a character string. %SCAN extracts a word from a character string. %LENGTH determines the length of a character string. Using Micro Functions
54. Macro functions have the same basic syntax as the corresponding DATA step functions and yield similar results. Manipulating Character Strings Using Micro Functions
55. Most comparison operators in the SAS language are case sensitive. Example: Create a summary of total fees outstanding for each course. %let paidval=n; proc means data=perm.all sum maxdec=0; where paid="&paidval"; var fee; class course_title; title "Outstanding Fees for Each Course"; run; Using Micro Functions
56. Because the value of the macro variable PAIDVAL was specified in lowercase , the WHERE expression finds no matching observations. All the values of the data set variable PAID are in uppercase . Partial Log Case of Text Issues Using Micro Functions
57. You can use the %UPCASE function to translate the value of a macro variable to uppercase before substituting its value in a SAS program. General form of the %UPCASE function: % UPCASE ( argumen t) Case of Text Issues Using Micro Functions
58. Example: For each course, create a summary of total fees outstanding and account for case. %let paidval=n; proc means data=perm.all sum maxdec=0; where upcase(paid)=”%upcase(&paidval)"; var fee; class course_title; title "Outstanding Fees for Each Course"; run; Case of Text Issues Using Micro Functions
63. Example: Print all courses held since the start of the current month. Use the %SUBSTR function and SYSDATE9 macro variable to determine the month and year. proc print data=perm.schedule; where begin_date between "01%substr(&sysdate9,3)"d and "&sysdate9"d; title "All Courses Held So Far This Month"; title2 "(as of &sysdate9)"; run; Extracting Parts of Strings Using Micro Functions
65. You can assign several words to a macro variable’s value and extract them with the %SCAN function. General form of the %SCAN function: %SCAN ( argument , n < , delimiter s>) Extracting Parts of Strings Using Micro Functions
66.
67.
68. Example: Use PROC DATASETS to investigate the structure of the last data set created. data work.thisyear; set perm.schedule; where year(begin_date) = year(“sysdate9”d); run; %let libref=%scan(&syslast,1); %let dsname=%scan(&syslast,2,.); proc datasets lib=&libref nolist; title "Contents of the Data Set &syslast"; contents data=&dsname; run; quit; Extracting Parts of Strings Using Micro Functions
70. By using the automatic macro variables SYSDATE9 and SYSTIME you can include the date and time in a title: title "Report Produced on &sysdate9."; title2 "at &systime."; generates Using Micro Functions
71. SYSDATE9 represents the date that the SAS session started and SYSTIME represents the time the SAS session started . If you started your interactive SAS session at 10:30 PM yesterday, what date and time would be in your report? What if you wanted to see the date or time in some other format besides DATE9.? Other SAS Functions Using Micro Functions
72. You can utilize the %SYSFUNC macro function to execute SAS functions. Example: The following code was submitted on Friday, June 9, 2000: title "%sysfunc(today(),weekdate.) - SALES REPORT"; The title on the next report would be Friday, June 9, 2000 – SALES REPORT Other SAS Functions Using Micro Functions
73.
74. All SAS functions can be used with %SYSFUNC except: DIF DIM HBOUND IORCMSG INPUT LAG LBOUND MISSING PUT RESOLVE SYMGET All Variable Information Functions Other SAS Functions Using Micro Functions
77. You can reference macro variables anywhere in your program. Some applications may require placing a macro variable reference adjacent to leading and/or trailing text tex t &variable &variable text tex t &variable text or referencing adjacent macro variables &variable &variable in order to build a new token. Combining Macro Variable references with Text
78. You can place text immediately before a macro variable reference to build a new token. Example: Data sets are stored in a SAS data library with this naming convention: Y yymon yy can be 90 , 91 , 92 , 93 , 94 , and so on. mon can be JAN , FEB , MAR , and so on. Write a program that uses a macro variable to build the month portion of the SAS data set name. Combining Macro Variable references with Text
79. %let month=jan; proc chart data=perm.y90 &month ; hbar week / sumvar=sale; run; proc plot data=perm.y90 &month ; plot sale*day; run; PROC CHART DATA=PERM.Y90 JAN ; HBAR WEEK / SUMVAR=SALE; RUN; PROC PLOT DATA=PERM.Y90 JAN ; PLOT SALE*DAY; RUN; generates Combining Macro Variables with Text Combining Micro Variable references with Text
80. You can reference macro variables that have no blanks between them to build new tokens. Example: Modify the previous program to allow both the month and the year to be substituted. %let year=90 ; %let month=jan; proc chart data=perm.y &year &month; hbar week / sumvar=sale; run; proc plot data=perm.y &year &month; plot sale*day; run; Combining Macro Variables with Text Combining Micro Variable references with Text
81. PROC CHART DATA=PERM.Y 90 JAN; HBAR WEEK / SUMVAR=SALE; RUN; PROC PLOT DATA=PERM.Y 90 JAN; PLOT SALE*DAY; RUN; The generated program is identical to the program in the previous example. Combining Macro Variables with Text Combining Micro Variable references with Text
82. You can place text immediately after a macro variable reference if it does not change the macro variable name. Example: Modify the previous program to substitute the name of an analysis variable. %let year=90; %let month=jan; %let var=sale; proc chart data=perm.y&year&month; hbar week / sumvar =&var ; run; proc plot data=perm.y&year&month; plot &var *day; run; Combining Macro Variables with Text Combining Micro Variable references with Text
83. PROC CHART DATA=PERM.Y90JAN; HBAR WEEK / SUMVAR= SALE ; RUN; PROC PLOT DATA=PERM.Y90JAN; PLOT SALE *DAY; RUN; The generated program is identical to the program in the previous example. Combining Macro Variables with Text Combining Micro Variable references with Text
84. Example: Modify the previous program to allow a base SAS or SAS/GRAPH procedure. /* GRAPHICS should be null or G */ %let graphics=g ; %let year=90; %let month=jan; %let var=sale; proc &graphicschart data=perm.y&year&month; hbar week / sumvar=&var; run; proc &graphicsplot data=perm.y&year&month; plot &var*day; run; What is wrong with this program? Combining Macro Variables with Text Combining Micro Variable references with Text
85. SAS interprets the macro variable’s name to be GRAPHICSCHART because there is no delimiter between the macro reference and the rest of the text. Partial Log Combining Macro Variables with Text Combining Micro Variable references with Text
86. Macro Variable Name Delimiter The word scanner recognizes the end of a macro variable name when it encounters a character that cannot be part of the name token. A period ( .) is a special character that is treated as part of the macro variable reference and does not appear when the macro variable is resolved. Combining Micro Variable references with Text
87. Example: Correct the resolution problem in the previous example. %let graphics=g; %let year=90; %let month=jan; %let var=sale; proc &graphics. chart data=perm.y&year&month; hbar week / sumvar=&var; run; proc &graphics. plot data=perm.y&year&month; plot &var*day; run; Macro Variable Name Delimiter Combining Micro Variable references with Text
88.
89. Example: Modify the previous program to include a macro variable used to define the libref. %let lib=perm; %let graphics=g; %let year=90; %let month=jan; %let var=sale; libname &lib ’SAS-data-library’; proc &graphics.chart data =&lib. y&year&month; hbar week / sumvar=&var; run; proc &graphics.plot data =&lib. y&year&month; plot &var*day; run; What is the problem this time? Macro Variable Name Delimiter Combining Micro Variable references with Text
90. The statements %let lib=perm; ... libname &lib 'SAS-data-library'; proc &graphics.chart data= &lib .y &year&month ; ... proc &graphics.plot data =&lib .y &year&month ; LIBNAME PERM 'SAS-data-library'; PROC GCHART DATA= PERM Y 90JAN ; HBAR WEEK / SUMVAR=SALE; RUN; PROC GPLOT DATA= PERM Y 90JAN ; PLOT SALE*DAY; RUN; send these statements to the SAS compiler: The period after &lib is interpreted as a delimiter. Macro Variable Name Delimiter Combining Micro Variable references with Text
91. Use another period after the delimiter period to supply the needed token. %let lib=perm; ... libname &lib 'SAS-data-library'; proc &graphics.chart data= &lib ..y &year&month ; ... proc &graphics.plot data =&lib ..y &year&month ; Macro Variable Name Delimiter Combining Micro Variable references with Text
92. proc &graphics.chart data= &lib ..y &year&month ; ... PROC GCHART DATA= PERM .Y 90JAN ; ... The first period is treated as a macro variable name delimiter. The second period is simply text. The compiler receives delimiter text Macro Variable Name Delimiter Combining Micro Variable references with Text
95. The SAS language uses matched pairs of quotes to distinguish character constants from names. The quotes are not stored as part of the token they define. data one; var='TEXT'; run; VAR is stored as a four-byte variable with the value TEXT . If TEXT were not enclosed in quotes, it would be treated as a variable name . Quoting Micro Facility
96. proc print; title "Joan’s Report"; run; The title text is Joan’s Report and does not contain the outer matched quotes . The outer quotes are double quotes to prevent ambiguity with respect to the unmatched single quote (apostrophe) within the text. Quoting Micro Facility
97. Suppose you want to store one or more SAS statements in a macro variable. options symbolgen; %let prog=data new; x=1; run; &prog proc print; run; Quoting Micro Facility
98. How do you explain the processing reported in this SAS log? Quoting Micro Facility
99. In the previous example, SAS interpreted the first “;” as the end of the macro assignment statement. In some applications you need to mask the meaning of text you want to assign to a macro variable. You can use macro quoting functions to remove the normal syntactic meaning of tokens. Need for Macro Quoting Quoting Micro Facility
100. The %STR function is used to protect (quot e) tokens so the macro processor does not interpret them as macro-level syntax. General form of the %STR function: %STR ( argumen t) argument can be any combination of text and macro triggers. Quoting Micro Facility
101.
102.
103. There are a number of ways that text can be quoted. Method One: Quote all text. %let prog=%str(data new; x=1; run;); The %STR Function Quoting Micro Facility
104. Method Two: Quote only the semicolons. %let prog=data new%str(;) x=1%str(;)run%str(;); The %STR Function Quoting Micro Facility
105. Method Three: Create a macro variable with a quoted value. %let s=%str(;); %let prog=data new&s x=1&s run&s; The %STR Function Quoting Micro Facility
106. Example: Use the %STR function to store one or more SAS statements as the value of the macro variable PROG. Display the value of PROG through the SYMBOLGEN system option using a %PUT statement. The %STR Function Quoting Micro Facility
108. options symbolgen; %let text=Joan’s Report; proc print data=perm.courses; where days >3; title "&text"; run; Example: Suppose you want to assign text containing an apostrophe to a macro variable. The %STR Function Quoting Micro Facility
110. The word scanner interprets the apostrophe as the beginning of a literal defined by a pair of single quotes. The %STR function can also be used to quote tokens that normally occur in pairs: ’ " ) ( The %STR Function Quoting Micro Facility
111. To perform this quoting, you must precede any of the above tokens with a percent sign within the %STR function argument. %let text=%str(Joan % ’s Report); %let text=Joan%str( % ’)s Report; The value of TEXT is Joan’s Report in both cases. The %STR Function Quoting Micro Facility
112. options symbolgen; %let text=%str(Joan%’s Report); proc print data=perm.courses; where days >3; title "&text"; run; %put The value of TEXT is: &text; Example: Use the %STR function to assign text containing an apostrophe to a macro variable. The %STR Function Quoting Micro Facility
114. You were earlier introduced to the %SYSFUNC macro function and used it to include a date in a title. For example, title "Report Produced on sysfunc(today(),mmddyy10.)"; results in the title Report Produced on 06/12/2000 for a report run on June 12, 2000. Quoting Micro Facility
115. If you wanted to use a different format, the results may not be what you expect. For example, title "Report Produced on %sysfunc(today(),worddate.)"; results in the title: Report Produced on June 12, 2000 Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility
116. The extra blanks are from the default length of worddate . You need to left-justify the resulting formatted date. Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility
117. You cannot nest functions within %SYSFUNC, but you can use a %SYSFUNC for each function needed. Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility
118. However, the code title “Report Produced on %sysfunc(left(%sysfunc(today(),worddate.))))”; results in the following error message: ERROR:The function LEFT referenced by the %SYSFUN or %QSYSFUNC macro function has too many arguments. Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility
119. The LEFT function expects only one argument. However, you are passing it "June 12, 2000". It is interpreting the comma as the delimiter between two arguments. Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility
120. You can mask the comma by using the %QSYSFUNC function instead: title "Report Produced on %sysfunc(left(%qsysfunc(today(),worddate.))))"; The title is now: Report Produced on June 12, 2000 Quoting with %SYSFUNC (Self-Study) Quoting Micro Facility