BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ranjeeta
Pyrite | Level 9

Options mprint;
621
622 /* EXPORT WAIT TIMES SUMMARY BY URGENCY TO EXCEL */
623 /* USE DYNAMIC DATA EXCHANGE (DDE) TO EXPORT SAS RESULTS TO EXCEL */
624 OPTIONS NOXWAIT NOXSYNC;
625 X "'Y:\KNOWLEDGE MANAGEMENT\Analytics\Funding\QBP\Output\Test.xlsx'"
625! ;
626
627 /* EXPORT VOLUMES BY SITE ONTO CELLS A3 TO G1121 (ROW 3-1121, COLUMNS 1 TO 7) */
628 FILENAME Test DDE 'EXCEL|ISCHEMIC!R3C1:R1121C7' NOTAB;
629 DATA _NULL_;
630 SET QBP_stroke;
631
632 IF MISSING(SITE_LHIN) THEN DO;
633 FAC_LHIN='Ontario';
634 FAC_NO='Ontario';
635 FAC_NAME='Ontario';
636 END;
637
638 FILE STROKE DELIMITER='09'X DSD;
639 PUT FY FAC_LHIN FAC_NO FAC_NAME FLAG_EX1 FLAG_POT N;
640 RUN;

NOTE: Variable N is uninitialized.
NOTE: The file STROKE is:
DDE Session,
SESSION=EXCEL|ISCHEMIC!R3C1:R1121C7,RECFM=V,
LRECL=32767

NOTE: 40048 records were written to the file STROKE.
The minimum record length was 26.
The maximum record length was 66.
NOTE: There were 40048 observations read from the data set WORK.QBP_STROKE.
NOTE: DATA statement used (Total process time):
real time 2.73 seconds
cpu time 0.20 seconds

 

 

My DDE is not properly exporting the results 

 

Can someone advise what is going wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

What does "My DDE is not properly exporting the results" mean in this context.

 

If it is the value of the variable N then the note:

NOTE: Variable N is uninitialized.

tells is there are no values and likely the variable didn't exist before the PUT statement executed.

 

If you meant to write to the Excel file you set up in the Filename statement then you should use that instead of "FILE STROKE".

 

DDE is becoming extremely difficult to work with as Microsoft is not extending the tech and other programs are using part of the system resources that DDE thinks it has and will interfere with using DDE at all.

View solution in original post

3 REPLIES 3
Reeza
Super User

@Ranjeeta wrote:

 

 

My DDE is not properly exporting the results 

 

Can someone advise what is going wrong?


What does that mean? Does it miss one variable?  'not properly' is very vague and doesn't tell us if your computer exploded or if it's all going to one line. 

 

And did you fix the note about the missing variable? Your input data does not have a variable named N that it's expecting. 

NOTE: Variable N is uninitialized.

 

 


@Ranjeeta wrote:

Options mprint;
621
622 /* EXPORT WAIT TIMES SUMMARY BY URGENCY TO EXCEL */
623 /* USE DYNAMIC DATA EXCHANGE (DDE) TO EXPORT SAS RESULTS TO EXCEL */
624 OPTIONS NOXWAIT NOXSYNC;
625 X "'Y:\KNOWLEDGE MANAGEMENT\Analytics\Funding\QBP\Output\Test.xlsx'"
625! ;
626
627 /* EXPORT VOLUMES BY SITE ONTO CELLS A3 TO G1121 (ROW 3-1121, COLUMNS 1 TO 7) */
628 FILENAME Test DDE 'EXCEL|ISCHEMIC!R3C1:R1121C7' NOTAB;
629 DATA _NULL_;
630 SET QBP_stroke;
631
632 IF MISSING(SITE_LHIN) THEN DO;
633 FAC_LHIN='Ontario';
634 FAC_NO='Ontario';
635 FAC_NAME='Ontario';
636 END;
637
638 FILE STROKE DELIMITER='09'X DSD;
639 PUT FY FAC_LHIN FAC_NO FAC_NAME FLAG_EX1 FLAG_POT N;
640 RUN;

NOTE: Variable N is uninitialized.
NOTE: The file STROKE is:
DDE Session,
SESSION=EXCEL|ISCHEMIC!R3C1:R1121C7,RECFM=V,
LRECL=32767

NOTE: 40048 records were written to the file STROKE.
The minimum record length was 26.
The maximum record length was 66.
NOTE: There were 40048 observations read from the data set WORK.QBP_STROKE.
NOTE: DATA statement used (Total process time):
real time 2.73 seconds
cpu time 0.20 seconds

 

 

My DDE is not properly exporting the results 

 

Can someone advise what is going wrong?


 

ballardw
Super User

What does "My DDE is not properly exporting the results" mean in this context.

 

If it is the value of the variable N then the note:

NOTE: Variable N is uninitialized.

tells is there are no values and likely the variable didn't exist before the PUT statement executed.

 

If you meant to write to the Excel file you set up in the Filename statement then you should use that instead of "FILE STROKE".

 

DDE is becoming extremely difficult to work with as Microsoft is not extending the tech and other programs are using part of the system resources that DDE thinks it has and will interfere with using DDE at all.

Patrick
Opal | Level 21

@Ranjeeta 

Don't use DDE anymore. There are other and better options how you can write to Excels using SAS.

https://blogs.sas.com/content/sasdummy/2014/10/14/dde-is-doa/ 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1052 views
  • 2 likes
  • 4 in conversation