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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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