Help using Base SAS procedures

Reg:Importing Excel and Formatting during Importing Process.....?

Reply
Regular Contributor
Posts: 229

Reg:Importing Excel and Formatting during Importing Process.....?

Hi i am having a excel file i want to import it into sas and I should declare length,format and informat during the importing only. I have tryed by using FILENAME and INFILE but it is not coming can any one help me the code for this. And with out DDE,Before a dataset being creating i.e during the import process i need to apply formats.
Regular Contributor
Posts: 151

Re: Reg:Importing Excel and Formatting during Importing Process.....?

Hi
If you have to use DDE-engine then look at the example of the code below:
[pre]
filename dt dde 'excel|dt!r2c1:r65536c23' ;
data dt2 ;
infile dt missover notab dlm='09'x dsd ls=20000;
informat site $3. sbal_kod $5. ss_kod $15. simbol $5. ss_naim $100. ss_ostd comma20. ss_ostc comma20.
client $100. k_client $12. client_t $1. paccsbal $8. acc4 $8. comiss $1.
comm_adj $200. drcr $2. sbalname $200. acc3 $8. acc2 $8. acc1 $8. accnr4 $200. accnr3 $200. accnr2 $200. accnr1 $200.;
input site sbal_kod ss_kod simbol ss_naim ss_ostd ss_ostc client k_client client_t paccsbal acc4 comiss comm_adj
drcr sbalname acc3 acc2 acc1 accnr4 accnr3 accnr2 accnr1;
run;
[/pre]


Oleg.
Regular Contributor
Posts: 151

Re: Reg:Importing Excel and Formatting during Importing Process.....?

If you don't want DDE then use libname Excel engine:
[pre]
libname xl excel 'd:\mbm\2010\acc.xls';
data comiss;
length comm_adj $200. ss_naim $100. client $100.;
informat comm_adj $200. ss_naim $100. client $100.;
set xl.newacc;
format comm_adj $200. ss_naim $100. client $100.;
run;
libname xl clear;
[/pre]

Oleg.
Ask a Question
Discussion stats
  • 2 replies
  • 88 views
  • 0 likes
  • 2 in conversation