Thanks a lot ! data_null_ and cwilson. it really work well.
Here's another suggestion if you have differing numbers of commas in column A.
Create an array of your desired variables, then
Create an array of character variables t1 - tM where M = number of input variables (n) + maximum number of commas.
The length of each temporary variable must exceed the length of any input variable.
Input the data into the variables t1 - tM as text.
if t{n+1} is not blank then
t1 = catx (', ', t{1}, t{2}) ;
t{2} = t{3} ; etc to t{M-1} = t{M} ;
repeat until t{n+1} is blank
copy values to the array of desired values
Drop all the t{*} values
Use do while () or do until () to loop until t{n+1} is blank
Use do k = 1 to n to copy values from the t{*} array to the wanted values
Do any text to numeric conversion en route as required
Richard
Maybe your csv file is not real CSV file. Use double quote around it .
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.