SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

Problem with transferring values to Excel worksheet using DDE.

Reply
N/A
Posts: 0

Problem with transferring values to Excel worksheet using DDE.

I have a SAS table, MyTable, with 10 rows and 23 columns. The columns are named col1-col23.
I am using DDE to transfer the table to a Excel worksheet MySheet in the workbook MyWorkbook.

I have declared a range

filename MyRange dde 'excel[MyWorkbook.xls]MySheet!r1c1:r10c23' notab;

I use

data _null_;
set MyTable;
file MyRange;
put col1 '09'x col2 '09'x col3 '09'x ......... col22 '09'x col23;
run;

The first 3 rows in the Excel sheet is filled correctly, but in the 4th row the 3 last columns, 21-23, is empty, and the values that should be in those cells comes in row 5, columns 1-3. There are no more values on row 5.
The rest of the values then starts on row 6, and now again values are placed in all 23 columns.

What can be wrong?
Respected Advisor
Posts: 3,775

Re: Problem with transferring values to Excel worksheet using DDE.

What kind of data step messages did you receive?

Try increasing the LRECL, On the FILENAME or on the FILE statement.

You may find using DSD DLM='09'x FILE statement option easier than putting the TAB as constant text.
N/A
Posts: 0

Re: Problem with transferring values to Excel worksheet using DDE.

Many thanks!

LRECL=291 did it, but not LRECL=290.

I suppose it was because the first 3 rows contained integers that they were transferred correctly.

The following rows contained real numbers.
Ask a Question
Discussion stats
  • 2 replies
  • 167 views
  • 0 likes
  • 2 in conversation