DatacomDATACOM - ADCISCOMMON SERVICES FOR Z/OS90S SERVICESDATABASE MANAGEMENT SOLUTIONS FOR DB2 FOR Z/OSCOMMON PRODUCT SERVICES COMPONENTCommon ServicesCA ECOMETER SERVER COMPONENT FOCEasytrieve Report Generator for Common ServicesINFOCAI MAINTENANCEIPCUNICENTER JCLCHECK COMMON COMPONENTMainframe VM Product ManagerCHORUS SOFTWARE MANAGERCA ON DEMAND PORTALCA Service Desk Manager - Unified Self ServicePAM CLIENT FOR LINUX ON MAINFRAMEMAINFRAME CONNECTOR FOR LINUX ON MAINFRAMEGRAPHICAL MANAGEMENT INTERFACEWEB ADMINISTRATOR FOR TOP SECRETXpertware
Issue/Introduction
Is there anyway using Dataquery DQL or SQL to find if a numeric field contains non numeric data.
Environment
z/os or z/VSE, CA Datacom/DB
Resolution
You may do one of the following:
From DQL (Dataquery Language). - Do a DISPLAY or PRINT command request on that table and find the output fields showing "***E1***". E1 : A numeric column named in a SET, PRINT, or DISPLAY command contains non-numeric data. So, a PRINT or DISPLAY will display error "E1" if the field does not contain numeric data.
- Do a DBUTLTY EXTRACT and via a COBOL program or other meaning identify the invalid non numeric field.
From SQL - Write a small SQL program using a DECLARE CURSOR/OPEN cursor/FETCH/CLOSE cursor. Declare the cursor for a select on this problem column CESS_CNT and all the columns from the master key. The FETCH fails on each row with invalid data in that column CESS_CNT with SQLCODE -161. So test on that SQLCODE and then display the values of the master key columns so that you know which row needs to be corrected. You test on that SQLCODE -161 during the FETCH , do the display and then FETCH the next row until all rows have been read. Then you close the cursor.