Hi,
Q1 Below there is a list of names and i want to select only second names from the list.
Alan Schoenberg
Alan Barnes
Alex Russell
Amy Cox
Amy Hunt
Andy Gerbode
Benjamin Patter
Clytie Kelty
Julie Kriz
Liz Price
Robert Waldorf
Marina Lichtens
Q2 From the full address i want to select only second name the data is in miss mode
Alan Schoenberg, Ontario, United States of America
Alan Barnes, United States of America
Benjamin Patter, Australia
Clytie Kelty, Denmark
Julie Kriz,West, British Columbia
Liz Price,Northwest Territories, United States of America
Robert Waldorf, United Kingdom
Marina Lichens, California, United States of America
Q3 Below Product Name has been listed and i want only those observation in output if Product Name have Chair and Machine
Staples Colored Bar Computer Paper
Office Star - Ergonomic Mid Back Chair with 2-Way Adjustable Arms
Bevis 36 x 72 Conference Tables
Global Leather Task Chair, Black
Bush Advantage Collection® Round Conference Table
Global Stack Chair without Arms, Black
Office Star - Ergonomic Mid Back Chair with 2-Way Adjustable Arms
Global Leather Task Chair, Black
GBC DocuBind 200 Manual Binding Machine
Staples® General Use 3-Ring Binders Machine
Q1: scan(name,2)
Q2: scan(fullAddress,2)
Q3: indexc(lowcase(productName),'chair','machine')>0
- Cheers -
Q1: scan(name,2)
Q2: scan(fullAddress,2)
Q3: indexc(lowcase(productName),'chair','machine')>0
- Cheers -
Awesome 1st and 2nd question i got answer but 3rd question i think sum thing missing i not getting exact output answer. but ur answers are perfect. Thanks’ a Lot.
This looks a lot like homework/learning exercise so you should give it a shot. There are some hints below on functions you can use.
Q1 - Scan
Q2 - I don't understand the question
Q3 - Find or Index function
Thank You even ur answer are right.
Names are obnoxious data. The question might be do you want the Last (family) name or the second word. Consider:
Pierre Le Blanc
Dick Van Dyke
Jorge De La Cruz
Which piece to you want from those?
Again since this is apparently an exercise there are a number of functions that may come into play:
Index, Scan, Find, FindW, IndexW
are likely candidates.
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.