Interestingly, I found that using a SQL merge, rather than a datastep
bypasses the variable length issue....
________________________________
Bruce A. Johnson
XXXX@XXXXX.COM
-----Original Message-----
From: Chakravarthy, Venky [mailto: XXXX@XXXXX.COM ]
Sent: Tuesday, September 09, 2003 4:12 PM
To: XXXX@XXXXX.COM
Subject: Re: Trap a warning?
Bruce,
I have done something like the following before. You can add code to abort
further processing.
proc sql noprint ;
select length into : lenof1 separated by " "
from dictionary.columns
where libname = "WORK" and
memname = "FIRST" and
name = "MYBYVAR" ;
select length into : lenof2 separated by " "
from dictionary.columns
where libname = "WORK" and
memname = "SECOND" and
name = "MYBYVAR" ;
quit ;
%macro warnme ;
%if &lenof1. ^= &lenof2. %then
%put WARNING: Unequal lengths of BY Variables. STOP. ;
%mend warnme ;
%warnme
Kind Regards,
_________________________________
Venky Chakravarthy
E-mail: swovcc_AT_hotmail_DOT_com
-----Original Message-----
From: Bruce Johnson [mailto: XXXX@XXXXX.COM ]
Sent: Tuesday, September 09, 2003 4:57 PM
To: XXXX@XXXXX.COM
Subject: Trap a warning?
I'm writing a program to do a merge, and I want to look for an instance
where the BY fields are of differing lengths. SAS generates this message:
WARNING: Multiple lengths were specified for the BY variable MDID by input
data sets. This may cause unexpected results. How can I programmatically
look for this warning and either send a message to the listing, or stop the
program?
Thanks for your help (as always)
_______________________________
Bruce A. Johnson
Senior Data Analyst
Solucient, LLC
(847) 440-9635
XXXX@XXXXX.COM
This message is a private communication. It may contain information that is
confidential and legally protected from disclosure. If you are not an
intended recipient, please do not read, copy or use this message or any
attachments, and do not disclose them to others.
Please notify the sender of the delivery error by replying to this message,
and then delete it and any attachments from your system. Thank you.
Solucient LLC.
LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail
by anyone else is unauthorized. If you are not an addressee, any disclosure
or copying of the contents of this E-mail or any action taken (or not taken)
in reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately.
This message is a private communication. It may contain information that is
confidential and legally protected from disclosure. If you are not an
intended recipient, please do not read, copy or use this message or any
attachments, and do not disclose them to others.
Please notify the sender of the delivery error by replying to this message,
and then delete it and any attachments from your system. Thank you.
Solucient LLC.