BookmarkSubscribeRSS Feed
Ganeshk
Obsidian | Level 7
Hi Team,

I want to extract the value which is having semicolon and provide it as a separate column (required). The data sample is given below:

</id var1 var2 var3 var4 var5 required
1 ex 2345; tf rf yh 2345;
2 st 5 yg uh 7890; 7890;
3 1112; 5rs 77 ggjio yghjk 1112;
4 rt td 77tg 6070; tg768 6070;
5 fg yj 4516; tdhjk tune 4516;
>


Thanks,
Ganesh K
1 REPLY 1
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Best is data in the form of a data step.

Or copy text and paste into text box opened on the forum with the </> icon that appears above the message window.

 

Perhaps you are looking for the SCAN function which allows you to specify a delimiter between text and extract the bits separated by that delimiter.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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
  • 1 reply
  • 492 views
  • 0 likes
  • 2 in conversation