From the data presented, it does not appear to be a "CSV" formatted file. What is unclear is whether the entire data-string is contained in one cell or multiple?
You can use SAS PROC IMPORT to read the external file -- this process will create a SAS database member/file for you. Then you can use a SAS DATA step with a SET to read your imported SAS file, and use a SAS character variable assignment statement. Code a LENGTH or ATTRIB statement to declare the new variable that will contain the sub-string value, and make use of the SCAN function, as shown below:
data _null_;
oldvar = "A B C D XXXXXXX';
length newvar $20;
newvar = scan(oldvar,-1,' ');
putlog _all_;
run;
Suggest using the Google searches below and review SAS-hosted documentation and supplemental technical / conference reference material.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search argument, this topic / post:
proc import csv introduction site:sas.com
data step programming introduction site:sas.com
data step scan function site:sas.com