Advanced cert study Flashcards

(31 cards)

1
Q

proc fcmp

A

outlib arument is required*
PROC FCMP OUTLIB =libname.dataset.package;

FUNCTION name (parameter-1, …,
parameter-N);
program-statements;
RETURN (expression);
ENDSUB;
run;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

macro loops

A

%do i=1 %to
%end
works with %do %until and %do %while

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

subroutine (proc fcmp cont)

A

SUBROUTINE subroutine-name (argument-1,…, argument-n);
OUTARGS out-argument-1, …, out-argument-n;
… more-program-statements …
ENDSUB;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

%str

A

masks the normal meaning of these tokens: + - * / , < > = ; ‘ “ %NRSTR also mask macro call values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

scan function

A

SCAN(string,n)

breaks up a string into words that can be returned as the value. returns the nth word;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

proc sql logic

A
case
when-then
when then 
else 
end as var
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

symputx and symget

A

call symputx(‘var’, value) symget(‘var’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

find function

A

FIND(string,tgtsubstring)
searches a string for a certain substring returns the position of the first occurence of the substring within the string if found , else 0

Findc(string, charlist, )
returns first occurence of any char else 0

FINDW(string,word);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

copying tables

A

create table tablename
like oldtable: creates an empty table

Create table tablename as query expression; creates table from a query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

All and corr

A

all does not remove matching rows

corr remove nonmatching columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

%scan

A

%SCAN(argument, n )

returns the nth word of an argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Union

A
select *
from one
union
select *
from two;

UNION
Unique rows from both tables are selected with columns
overlaid.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

select distinct

A

eliminates duplicate rows in query results

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Hash objects

A
data mem_type;
length Code $2 MemberType $40;
if _N_=1 then do;
declare hash T();
T.definekey('key');
T.definedata('MemberType');
T.definedone();
end;
set orion.europe_customers;
T.find(); * matches vars with same value otherwise use
t.find(key: 'var');
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

%Eval

A

%EVAL(expression)

performs arithmetic ops, truncates non int restults, returns 1 or 0 for logical ops, retuns a null value for non-int vals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

%local

A

delcares macro values within a macro function, like a %let statement

17
Q

inner and outer joins

A

inner return rows with matching keys, up to 256

outer rows return all rows with matching and nonmatching keys, only can be two at a time

18
Q

arrays

A

ARRAY array-name {number-of-elements}
;

2 dim array
ARRAY array-name {…,rows, cols}
;

19
Q

proc append

A
proc append
base=basetable
data=appendtable
; 
quit;
20
Q

except

A
select *
from one
except
select *
from two;

Unique rows from the first table that are not found in
the second table are selected.

21
Q

proc sql contents equi

A

proc sql:

describe table;

22
Q

Intersect

A
select *
from one
intersect
select *
from two;
Common unique rows from both tables are selected.
23
Q

set operators

A

SELECT …
EXCEPT | INTERSECT | UNION | OUTER UNION
SELECT …

24
Q

where v having clause

A

The WHERE clause is processed before a GROUP
BY clause and determines which individual rows are
available for grouping.

The HAVING clause is processed after the GROUP
BY clause and determines which groups will be
displayed.

25
outer join syntax
``` SELECT column-1 FROM table-1 LEFT|RIGHT|FULL JOIN table-2 ON join-condition(s) ; ``` left and right are positional
26
colesce
COALESCE(argument-1,argument-2
27
%global
adds macro variables to the global symbol table with null values
28
%substr
%SUBSTR(argument, position ) returns portion of argument begining at position for a length of n chars, of no end takes rest of string if quotations are a part of string they are counted as chars
29
proc sql query
6 SELECT column-1 FROM table-1|view-1 > >;
30
proc format picture
proc format; picture US_Phone low-high='9 (999) 999-9999'; (prefix =' '); picture AU_Phone low-high='99 (9) 9999-9999'; (prefix =' '); run; 9 indicates no triming leading 0s, 0 indicate trim
31
%sysfunc
allows the use of most sas functions in a macro environemt