BookmarkSubscribeRSS Feed
sushil540
Calcite | Level 5

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

 

 

3 REPLIES 3
Miracle
Barite | Level 11
I don't use EG and I wonder if major=scan(Acadmic_Program,1); will work in EG.
TomKari
Onyx | Level 15

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.

sushil540
Calcite | Level 5

Thank you. It worked

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 919 views
  • 1 like
  • 3 in conversation