BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
2 REPLIES 2
data_null__
Jade | Level 19
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.
deleted_user
Not applicable
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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 2 replies
  • 709 views
  • 0 likes
  • 2 in conversation