Splitting data in to multiple columns

Reply
Occasional Contributor
Posts: 8

Splitting data in to multiple columns

Hi, I have a data file in which all data is concatenated. I want to split the data in to columns. How can i do that?

Any help is greatly appreciated.  

 

Thank you!

Here is the example

I want create seperate variables for below. Right now it is all in one column.

systemkey  eventkey   CDMDescription	UB92	revenuecategory	Qty	TotalChg    Count

 

 

systemkey eventkey   CDMDescription	UB92	revenuecategory	Qty	TotalChg    Count

103	5527	     Cytarabine Inj	0636	Medication	36	106.00	      12

103	5931	     Cytarabine Inj	0636	Medication	151	48.75	      12

103	6097	     Cytarabine Inj	0636	Medication	378	1185.90	       3

 

Super Contributor
Posts: 490

Re: Splitting data in to multiple columns

[ Edited ]

Give example of your currently concatenated data? How they are concatenated exactly?

Super User
Super User
Posts: 7,984

Re: Splitting data in to multiple columns

Precisely the advice given above, what consists of the divder between the data.  Once you know that then look up in the documentation the function scan(), e.g. for /

data want;
  set have;
  var1=scan(your_data,1,"/");
  var2=input(scan(your_date,2,"/");  /* For numeric */
etc.
run;

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 221 views
  • 0 likes
  • 3 in conversation