View previous topic :: View next topic
|
Author |
Message |
divate.dilip
New User
Joined: 11 May 2009 Posts: 15 Location: Mumbai
|
|
|
|
My input field has junk value in almost all the records, when we run the jcl the job failed with soc7. there is no problem with the program.
How to rectify the input field having junk values and I dont have to touch the records whose field,are not having junk values.
assuming that there are 10000 records. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You need to define rules for calling out something as "JUNK".
Then filter records based on these rules. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
1) I would disagree that there is no problem with the program. Had it been written correctly with the appropriate error handling routines, it would not abend but instead produce an error report.
2) What is supposed to happen to these supposedly "junk" values. We know nothing about what they are and what they should be, and without knowing those facts can not really make any useful suggestions.
3) Do you drop the invalid records or correct them. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Just 10000 records?? no problem I prefer to open the file in edit mode and delete the lines which appear as junk
Long live the RAW power of ISPF |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
there is no problem with the program. |
Opinions vary. . .
If the program is reading data that is not guaranteed to be correct, numeric fields must be validated before use. This code does not, so either the data needs to be re-created or the code fixed. |
|
Back to top |
|
|
divate.dilip
New User
Joined: 11 May 2009 Posts: 15 Location: Mumbai
|
|
|
|
We are not allowed to touch the program, so there is no chance of validating the field in the program. ( As this is the simplest solution, but I dont need that )
Junk means: my issue is lets assume the field is define as numeric and the input field has all alphabetic values, due to this program fails with soc7.
is there any way that we change a particular field(starts at column 5-9) of the file by replacing it with zeros for all records.
no matter the file is sequential or vsam, any solution is welcome.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
is there any way that we change a particular field(starts at column 5-9) of the file by replacing it with zeros for all records. |
Sure, read the file and validate that this field contains a valid numeric value otherwise move zeros to the field. Not acceptable most places as there is no way to know what has been corrupted/discarded. . . |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
... and please indicate that it was an S0C7, not soc7. This helps when others are searching. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
divate.dilip wrote: |
We are not allowed to touch the program, so there is no chance of validating the field in the program. |
Yea, sure....
Quote: |
is there any way that we change a particular field(starts at column 5-9) of the file by replacing it with zeros for all records. |
Are you asking if there is a utility driven "if not numeric" function? |
|
Back to top |
|
|
divate.dilip
New User
Joined: 11 May 2009 Posts: 15 Location: Mumbai
|
|
|
|
The input field is having alphabetic value I want to change it to numeric, if it can be done by utility also its fine.
As this has to be done to so many records, if its one or two its adjusted by deleting the records, but the records are huge, and we dont want to job to fail again due to that field only in the production again.
* All the records has to be updated at once for the field, no matter how u do it( without touching the program), in JCL if we introduce new step to validate that field would be fine. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest someone correct the process that creates the problem file so that all of the numeric fields have valid numeric data.
If it is ok to add another step, it would take about 15 minutes to implement a cobol program that would copy the file changing any "bad" values to zeros.
If it acceptable to simply throw away the field (i cannot imagine why this might be acceptable) and fill it with zeros, this can be done with the sort product used on the system. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi,
This is what puzzles me:
You say the numeric field at pos 5-9 contains alpha chars. Assuming the field has a legitimate business function, what kinds of values SHOULD it contain?
Wouldn't moving zeros there produce false/inaccurate results for the business process?
As Dick suggested, shouldn't the logic of the feeding program be checked to assure that substituting zeros for the alpha chars will do no harm and not produce misleading/inaccurate data? |
|
Back to top |
|
|
|