Google Answers Logo
View Question
 
Q: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE ( No Answer,   5 Comments )
Question  
Subject: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
Category: Computers > Programming
Asked by: redmocha-ga
List Price: $10.00
Posted: 18 Jan 2005 13:27 PST
Expires: 28 Jan 2005 09:07 PST
Question ID: 459443
I need to export a SAS (9.1) data set to a named range within Excel
(XP) via DDE, but missing numerical values keep getting exported with
non-null values. This causes errors in sorting and lookup functions
within my Excel template. There are about 70,000 of these missing
values, so manual replacement doesn't work and a find-and-replace
macro won't distinguish between blank cells and space-containing
cells. Any suggestions?

OPTIONS NOXWAIT NOXSYNC MISSING='00'x;/*'09'x*/
FILENAME SAS2XL 	DDE 'EXCEL|SYSTEM' NOTAB LRECL=8192;	
DATA  _NULL_;   SET DATA.ORC_CURRENT;

/*format ORC_&Q1_AGO 8.2 ORC_&Q2_AGO  8.2;*/
FILE ORCDATA; 
PUT
ID_RSSD +(-1) '09'x
DATE  +(-1) '09'x
BANK_NAME  +(-1) '09'x
FRB_DISTRICT +(-1)  '09'x
REGULATOR +(-1)  '09'x
PEER_GROUP +(-1)  '09'x;

Clarification of Question by redmocha-ga on 18 Jan 2005 13:29 PST
The code above does not produce the desired result, since SAS seems to
flush everything after the first missing cell is encountered (with
'00'x) and SAS fails to export a true NULL when '09'x is exported.

C. Del Anderson
Answer  
There is no answer at this time.

Comments  
Subject: Re: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
From: zorvek-ga on 26 Jan 2005 13:54 PST
 
Assuming you have already consulted the SAS documentation and experts
the most viable solution at this point is to add functionality to your
Excel workbook to clean up the exported data so that it can be used
effectively within the Excel environment. Since you have already tried
using the Excel find/replace function you will probably have to resort
to a macro to do the cleanup. Before providing further help with a
macro you will need to post a more detailed description of what the
resulting data looks like after it is placed in Excel by the SAS DDE
operation. Is it possible to see a sample workbook? If so you can post
a sample on any of the free posting sites such as geocities at
http://geocities.yahoo.com/ps/learn2/HowItWorks4_Free.html. Also
describe how you would like the resulting data to be formatted under
ideal conditions.

Kevin
Subject: Re: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
From: redmocha-ga on 26 Jan 2005 22:00 PST
 
I don't know how this works for payment, but I actually solved the
problem on my own using MISSING='09'x; instead of MISSING='00'x;. The
pointer reversal drops the trailing space and the missing tab
character, but it doesn't affect numeric data. It's a hack, I know,
but it does seem to work.
Subject: Re: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
From: zorvek-ga on 27 Jan 2005 09:04 PST
 
That looks like less of a hack than using an Excel macro to clean up an SAS mess.

The Google Answers service is still relatively unorganized and
incomplete. As far as I can tell you don't do anything and you will
only be charged a $0.25 listing fee. The only people who actually get
paid are GA authorized experts of which there don't seem to be any in
the Excel and SAS fields. I'm just a member like you trying to help so
I don't get paid. If you want real and fast answers to very specific
questions try www.expertsexchange.com - I'm one of the Excel "experts"
over there. If any GA admins are watching these threads they would be
well advised to look at EE and figure out what they are doing over
there to be so successful.

Kevin
Subject: Re: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
From: redmocha-ga on 27 Jan 2005 12:21 PST
 
Thanks for the website tip.... except that I initially read the link
as "Expert Sex Change."

C. Del Anderson
Subject: Re: Export Missing Numeric Values through SAS 9.1 to Excel Via DDE
From: zorvek-ga on 27 Jan 2005 20:02 PST
 
I believe others had the same observation and hense their current
address is http://www.experts-exchange.com/. They still own the old
address I gave you above and it redirects correctly to the new.

Kevin

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy