User:LainieH/test page

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

You can use the SUBSTR function to replace values within a variable. Suppose you have a variable called Employee_ID, where the first two characters indicate the branch an employee is assigned to:

LNAME	FNAME	EMPLOYEE_ID
Barczak	George	CP436
Adams	Linda	LA543
Preiss	Gloria	AU942

To change the first two letters of the employee ID to "DA", use the SUBSTR function on the left side of the assignment statement:

substr(employee_id,1,2)='DA';

Result:

LNAME	FNAME	EMPLOYEE_ID
Barczak	George	DA436
Adams	Linda	DA543
Preiss	Gloria	DA942
Submitted By LindaJAdams

Feel free to comment on this tip.




Check out the Tip of the Day page for details about this effort.



View the web-site usage statistics and the definition of terms used in that report.