IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

junk values in input field.causes s0c7


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
divate.dilip

New User


Joined: 11 May 2009
Posts: 15
Location: Mumbai

PostPosted: Tue Feb 23, 2010 5:26 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Feb 23, 2010 5:39 pm
Reply with quote

You need to define rules for calling out something as "JUNK".

Then filter records based on these rules. icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 23, 2010 5:39 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Feb 24, 2010 12:21 am
Reply with quote

Just 10000 records?? no problem I prefer to open the file in edit mode and delete the lines which appear as junk icon_biggrin.gif

Long live the RAW power of ISPF icon_pray.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 24, 2010 12:21 am
Reply with quote

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
View user's profile Send private message
divate.dilip

New User


Joined: 11 May 2009
Posts: 15
Location: Mumbai

PostPosted: Wed Feb 24, 2010 9:04 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 24, 2010 9:33 am
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Feb 24, 2010 10:42 am
Reply with quote

... and please indicate that it was an S0C7, not soc7. This helps when others are searching.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Feb 24, 2010 5:57 pm
Reply with quote

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.... icon_rolleyes.gif
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
View user's profile Send private message
divate.dilip

New User


Joined: 11 May 2009
Posts: 15
Location: Mumbai

PostPosted: Thu Feb 25, 2010 8:52 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Feb 25, 2010 9:46 am
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Feb 25, 2010 4:48 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top