BookmarkSubscribeRSS Feed
A_B_C
Calcite | Level 5
When I am trying output data using DDE facing the following problem hence any help is greatly appreciable.

When I am trying to export data to Excel using DDE, one row is splitting up into two rows and getting displayed in Excel. This is happening for few observations and rest are coming once observation per row.

The following is the code I am using:
filename myexcel dde "Excel|[SAE Template_1.xls]sae_details!r6c5:r567c29" notab;
data _null_;
set sae_final_n;
file myexcel ;
put patid '09'x saeno '09'x stdytrt '09'x saediag '09'x onsetdt '09'x onsettm '09'x stopdt '09'x stoptm '09'x saecrit '09'x acttkn '09'x outcm '09'x causal '09'x grade '09'x saecomm '09'x typerept '09'x crfsaediag '09'x crfonsetdt '09'x crfonsettm '09'x crfenddt '09'x crfendtm '09'x saecrt '09'x act_tkn '09'x outcome '09'x causal '09'x intenseassctcae ;
run;


here is the ouptut:
01007 7 DISEASE PROGRESSION 28-Dec-10 06:00:00 NA NA - Death Unlikely Grade 5 Preliminary EXTREME FATIGUE AND COUGH WITH HEMOPTYSIS 28-Dec-10 06:00 . . Hospitalization Unlikely Grade 3
01007 7 DISEASE PROGRESSION 28-Dec-10 06:00:00 NA NA Death - Death Unlikely Grade 5 Final DISEASE PROGRESSION 28-Dec-10 06:00 . . Death Unlikely Grade 5
01008 1 FATIGUE 22-May-10 12:40:00 28-May-10 03:40 Symptomatic treatment and hospitalization Recovered Unassessable/ Unclassifiable Grade 3 Final FATIGUE 22-May-10 12:40 28-May-10 03:40 Hospitalization
Hospitalization,SymptomaticRx Recovered Unassessable/ Unclassifiable Grade 3

In the above output for the patient 01008, the data after the variable 'saecrt' (hospitalization) the data for next variables(Hospitalization,SymptomaticRx Recovered Unassessable/ Unclassifiable Grade 3 ) displayed in the next row Excel. am not sure why is it happening. Any help is greatly appreciable
2 REPLIES 2
Oleg_L
Obsidian | Level 7
Hello.

Try to add linesize option.

filename myexcel dde "Excel|[SAE Template_1.xls]sae_details!r6c5:r567c29" notab;
data _null_;
set sae_final_n;
file myexcel ls=32000 ;
put patid '09'x saeno '09'x stdytrt '09'x saediag '09'x onsetdt '09'x onsettm '09'x stopdt '09'x stoptm '09'x saecrit '09'x acttkn '09'x outcm '09'x causal '09'x grade '09'x saecomm '09'x typerept '09'x crfsaediag '09'x crfonsetdt '09'x crfonsettm '09'x crfenddt '09'x crfendtm '09'x saecrt '09'x act_tkn '09'x outcome '09'x causal '09'x intenseassctcae ;
run;
A_B_C
Calcite | Level 5
Thats worked. Thanks a lot!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 2 replies
  • 1049 views
  • 0 likes
  • 2 in conversation