Joining and importing 25+ CSV files

Reply
N/A
Posts: 1

Joining and importing 25+ CSV files

I am relatively new to SAS and was wondering if you or could help me with the coding to join and import 25+ CSV files.

All data is in a single folder on my C drive and the format is the same throughout all files. Please see bellow sample of data.

SHA,PCT,PRACTICE,BNF CODE,BNF NAME                                    ,ITEMS  ,NIC        ,ACT COST   ,QUANTITY,PERIOD,               

Q30,5D7,A86001,0703010F0BEAAAC,Microgynon 30_Tab                       ,1,0.94,0.9,21,201101,                

Q30,5D7,A86001,0703022M0BBABAB,Depo-Provera_Inj 150mg/ml 1ml Pfs       ,1,6.01,5.56,1,201101,                

Thanks!

Respected Advisor
Posts: 4,641

Re: Joining and importing 25+ CSV files

try

data want;

INFILE "myPath\*.csv" dsd missover firstobs=2 eov=skip lrecl=2000;

input @;

if skip then skip=0;

else do;

     input sha $ PCT $ practice $ .... ;

     output;

     end;

run;

PG

PG
Ask a Question
Discussion stats
  • 1 reply
  • 159 views
  • 0 likes
  • 2 in conversation