BookmarkSubscribeRSS Feed
0 Likes

Please improve the diagnostics when reading malformed XML via SAS XMLMAP.

 

When there is an error, the error message in SASLOG is poor, only giving a general description of the error without giving any specific details.  For example, the element or attribute name is missing, so it's hard to locate in the XML file (see below).

 

It might be ok if the line number actually showed the line number, but instead SAS treats the entire file as a single record, and we have to figure out where column 150166 is.  This is z/OS, and there are no new-line characters, so the XML engine must rely on the count of reads to know how many records were read. 

 

The problem is especially bad as we often use variable length records.  We have no way to know which record has the error.  This is fundamental in z/OS, but this SAS XML engine must not be aware of z/OS files.  Please fix this.

 

 

ERROR: The attribute name is duplicated in element definition.
       occurred at or near line 1, column 150166

 

 

We also want the ability to detect the error in our SAS code so that we can handle the error ourselves.  Placing the error in the SASLOG doesn't help the person that submitted the XML since they are not the ones running the SAS job.  Instead another team runs the SAS program.  What I would like is the ability to detect the error in the SAS code so that I can send the error to the team that writes the XML via an email.  For example, have an option on the LIBNAME or OPTIONS statement that specifies a SAS dataset name to contains the errors.  The fields could be "Line, Column, ErrorMessage, Severity, Element, Attribute".  Then if there is an error, a subsequent DATA statement can read the file and build a report, so that the error messages are not squirreled away in the SASLOG. 

 

One more source of problems is when element or attribute names are mistyped.   If an element or attribute is optional and is misnamed, we have no way to detect the error.  For example, <MyElement name="Element-1" count="1">, if count="1" was entered as uppercase COUNT="1", it would not match the map and so not be read.  If the default of count is 0, we would not know that they really wanted 1.  The solution would be to throw an error whenever unknown elements or attributes are found to the error file above.  Then a subsequent step could read the errors and decide what to do. 

 

Thank you,

Michael Giaquinto

VP, Principal Engineer

Wells Fargo