Prev: help with counting occurences of a string
Next: How to include log-transformation in ARIMA-process in SAS?
From: jaheuk on 8 Feb 2010 03:37 Hi folks, on mainframe my job should end with CC > 0 when INVALID DATA LINES are detected!! However, I can not found any (system) option to do this?? see http://support.sas.com/onlinedoc/913/getDoc/nl/lrdict.hlp/a000279092.htm , which says: ERRORABNED does NOT affect invalid data lines Any suggestions? Regards, Herman
From: data _null_; on 8 Feb 2010 08:02 On Feb 8, 2:37 am, jaheuk <hejac...(a)gmail.com> wrote: > Hi folks, > on mainframe my job should end with CC > 0 when INVALID DATA LINES are > detected!! > However, I can not found any (system) option to do this?? > seehttp://support.sas.com/onlinedoc/913/getDoc/nl/lrdict.hlp/a000279092.htm > , which says: ERRORABNED does NOT affect invalid data lines > > Any suggestions? > > Regards, > Herman Set SYSCC when _ERROR_ is raised in the data step and ERRORABEND will be stop the job. This worked in windows so I assume it will work for you. options errorabend; data test; input a; if _error_ then do; call symputx('syscc',2048); stop; end; cards; 1 x 2 ;;;; run;
From: Arthur Tabachneck on 8 Feb 2010 07:56 Herman, I'm not sure if this would solve your problem, but probably worth a try: %LET SKIPIT=CANCEL; don�t print %LET SKIPIT=;do print PROC PRINT DATA=SOMEDATA; VAR ID NAME ADDRESS PHONE; RUN %SKIPIT;On Feb 8, 3:37 am, jaheuk <hejac...(a)gmail.com> wrote: i.e., set a macro variable to either equal missing or CANCEL, based on an error code, and then apply it to the run statement. HTH, Art ----------- > Hi folks, > on mainframe my job should end with CC > 0 when INVALID DATA LINES are > detected!! > However, I can not found any (system) option to do this?? > seehttp://support.sas.com/onlinedoc/913/getDoc/nl/lrdict.hlp/a000279092.htm > , which says: ERRORABNED does NOT affect invalid data lines > > Any suggestions? > > Regards, > Herman
From: Nathaniel Wooding on 8 Feb 2010 09:09
Herman Do you simply want to issue a system return code or do you want to abort the job. It has been quite a while since I played with such but take a look at the ABORT statement which has a couple options and can be used to set return codes. One way to use it would be to check the automatic variable _error_ and if it is set to 1, then you would execute the abort statement. Finding a solution to this type of problem is an example of when I find that it helps to have an older manual from, say, V5 or V6 where a lot of these mainframe tools were available and you don't have all of the stuff from other operating systems to dig through and complicate matters. HTH Nat Wooding Ps: Here is an example of checking _error_ data a; input x 8.; file print; if _error_ then put 'Error at ' _n_ 'the line is ' _infile_; cards; 1 2 a run; ----------- > Hi folks, > on mainframe my job should end with CC > 0 when INVALID DATA LINES are > detected!! > However, I can not found any (system) option to do this?? > seehttp://support.sas.com/onlinedoc/913/getDoc/nl/lrdict.hlp/a000279092.htm > , which says: ERRORABNED does NOT affect invalid data lines > > Any suggestions? > > Regards, > Herman CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you. |