Desktop productivity for business analysts and programmers

Extract Characters from Column

Reply
New Contributor
Posts: 2

Extract Characters from Column

Hello,

 

I am trying to extract Characters (Major) from a Field (Acadmic Program)

Example Below is Acadmic_Program that has Major and Degree. I am tryint to create a computed column in SAS enterprise Guide

to extract the Majors.

ENGL.AA

MATH.AS

PSY.AAS

 

For no i used Substring function (SUBSTR(t1.ACAD_PROGRAM,1,4) but it extracts first 4 characters and gives following output

ENGL

MATH

PSY.

 

How do i elimate the Period. I tried find function like in excel but it doesnt seem to work the same way

My output should be

ENGL

MATH

PSY

 

 

Any help is greatly appreciated.

 

Thank you

 

 

Regular Contributor
Posts: 226

Re: Extract Characters from Column

I don't use EG and I wonder if major=scan(Acadmic_Program,1); will work in EG.
PROC Star
Posts: 1,143

Re: Extract Characters from Column

Yes, you can use that function in EG.

 

The method is to use the query builder, and create a new advanced expression. You can then put the function into the expression.

New Contributor
Posts: 2

Re: Extract Characters from Column

Thank you. It worked

Ask a Question
Discussion stats
  • 3 replies
  • 160 views
  • 1 like
  • 3 in conversation