Validate SDA before saving to ECR
We have some code written by earlier team that read flat files data and create SDAs and push them to ECR Input Service. Now for every test cycle we have to load files to SDAs, check error log, fix the error, clear the ECR, and try new fixed flat files. I’d like to know if there is a method to validate SDA msgs prior to pushing to EFR Input operations ?
so everything we simple load flat files, create SDAs and validate them. If files all looks good with no SDA errros then we actually load them to ECR only once.
You can use an XML editor that can validate XML against a schema. You can get the schema via ##class(HS.SDA3.Container).ExportXMLSchemaAPI.
You can call GetNextSDA in a loop like ##class(HS.SDA3.Container).TestXMLParse does. But, I don't think this will catch datatype validation errors. To catch those, you could use ##class(%XML.Reader).Correlate.
Thanks will do some R&D on these methods, is there transaction concept here where I begin transaction and while loading SDAs any error faces the entire transaction got rolled back ?
I'm not sure what you are asking. Transactions are for saving to disk. The methods I referred to just load the SDA into memory.