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-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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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