Batch File: extract and create 2 files from an error file

March 5, 2013 at 05:31:55
Specs: Windows

I need to create 2 files from an error message file. The error message file contains various levels of severity. I am concerned with Warnings "W", Errors "E" and Severe "S". The level of severity is located on the file at the end of the error code "EX003524W". There is a unique id for each customer located on the first detail line for each customer. EX001000I (1) ********************* Customer 1: ABC123 Starts at input record 4 (byte 59)...The unique id for Customer 1 is "ABC123". The first file I need is a list of all the unique ids without errors. So, for this test scenario it would be ABC123 & ABC220. The second file is a list of all the unique ids in error with the description. Below is a sample of the error file.

* Rules on Queues processed AFTER composition because of variables used in rules.
EX001000I (1) ********************* Customer 1: ABC123 Starts at input record 4 (byte 59)
EX001002I (1) ======= Initial customer data read for 1: ABC123
EX003509I (1) The message (1-ReturnAddress) was placed in frame (1) on page (XL0011 Template).
EX003509I (2) The message (1-ReturnAddress) was placed in frame (1) on page (XL0013 Template).
EX001000I (2) ********************* Customer 2: ABC220 Starts at input record 15 (byte 346)
EX001002I (2) ======= Initial customer data read for 2: ABC220
EX003509I (3) The message (1-ReturnAddress) was placed in frame (1) on page (XL0011 Template).
EX003509I (4) The message (1-ReturnAddress) was placed in frame (1) on page (XL0013 Template).
EX001000I (3) ********************* Customer 3: Starts at input record 25 (byte 601)
EX003524W (1) A reference value (ABC543) could not be found in a reference file (Customer_MAIN). No value was set.
EX001002I (3) ======= Initial customer data read for 3: ABC543
EX003509I (5) The message (1-ReturnAddress) was placed in frame (1) on page (XL0011 Template).
EX003509I (6) The message (1-ReturnAddress) was placed in frame (1) on page (XL0013 Template).
EX001000I (4) ********************* Customer 4: Starts at input record 35 (byte 854)
EX003524W (2) A reference value (44444) could not be found in a reference file (Customer_MAIN). No value was set.
EX001002I (4) ======= Initial customer data read for 4: 44444
EX003509I (7) The message (1-ReturnAddress) was placed in frame (1) on page (XL0011 Template).
EX003509I (8) The message (1-ReturnAddress) was placed in frame (1) on page (XL0013 Template).


See More: Batch File: extract and create 2 files from an error file

Report •


#1
March 5, 2013 at 17:57:30

What about all the other error possibilities? How are those messages formatted, and do they include a "key" value for linking (cust-id like "ABC123" or cust-no like " :1"). If all errors reference a key value then it's do-able, but otherwise more difficult sequential analysis required but still do-able i think).

Report •

#2
March 5, 2013 at 18:05:38

The difference between the errors is the last character of the first field. EX#####W or S or E and will look just like the sample file. Thanks

Report •

Related Solutions


Ask Question