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

Junk Value in Database


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Wed May 19, 2010 10:42 pm
Reply with quote

Hi,

I have a DB where there are lot of junk values in many fields.

how can I fetch the fields with junk Value in it?

Thanks,

SAMeer
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed May 19, 2010 10:54 pm
Reply with quote

What are "junk values" and how did they get there?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed May 19, 2010 11:00 pm
Reply with quote

define junk values
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu May 20, 2010 3:04 pm
Reply with quote

syed-sameer-ahmed wrote:
how can I fetch the fields with junk Value in it?
FETCH them the way you FETCH the values from other columns unless you want them to display in a "human readable format". And if you want to display them in "human readable format" as I said - you should answer the question from Craig and Enrico.
Back to top
View user's profile Send private message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Mon May 31, 2010 6:41 pm
Reply with quote

I define Junk values are which are not recognisable by the system.

For example Hex code of Spaces is X'40' where are X'00' is undefined and cannot be handled in the Datastream and throws a XPROG 752 error.

I want to handle this condition in the program and replace the junk value bu space.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Mon May 31, 2010 6:45 pm
Reply with quote

Quote:
I want to handle this condition in the program and replace the junk value bu space.

ok go ahead... where is the problemc icon_cool.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 31, 2010 6:57 pm
Reply with quote

Quote:
XPROG 752

This is a CICS BMS problem, validate the data before putting it in a map.
Back to top
View user's profile Send private message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Mon May 31, 2010 6:57 pm
Reply with quote

but I how do I identify the junk values. X'00' is not the only one,how do I test the Validity of the character in Database.

Let me know If I am confusing. the problem is not only at a specific place,it is occurring at random places.

so I need to know how to handle it.

Thanks
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 31, 2010 7:11 pm
Reply with quote

Quote:
so I need to know how to handle it


clean up your input process.
clean up your database
for now, lay code in your program to convert the unwanted char.
Back to top
View user's profile Send private message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Mon May 31, 2010 8:12 pm
Reply with quote

Yes,my question is "how do I recognise the invalid characters in DB and in Cobol program,as I dont know what other values it can be ?"

I hope I am able to explain.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Mon May 31, 2010 9:22 pm
Reply with quote

Syed Sameer Ahmed, it sounds like you want a quick and easy way to recognize and correct the data causing your CICS BMS problems. Unfortunately, once this data has been allowed into your data base, there are NO QUICK,EASY SOLUTIONS to your problem. The best long-term solution is to scrub the data in the data base, removing or changing all data that should not be there. Yes, this takes a long time and is very expensive -- but it is the only sure-fire solution.

You can analyze the fields in the data base, determine which characters are invalid for your map, and handle them one by one in your program before putting the data on the map. This requires effort on your part, and any characters you miss will continue to impact your program.
Back to top
View user's profile Send private message
geekram

New User


Joined: 09 May 2010
Posts: 4
Location: Mumbai, India

PostPosted: Mon May 31, 2010 9:43 pm
Reply with quote

If you know the JUNK Characters in the database then you can replace them. If you dont know what all the JUNK characters that are going to come into or out from database then i think the best solution is the handle it in the application program.

Another most important is what are all the characters do you define as JUNK? There should be some boundaries set for the JUNK characters. In some scenarios some characters may be valid and in some other cases the same characters may be valid ones. So if we know what all characters you consider as JUNK then we can code the application program accordingly.
Anyways thats a good questions. Let me know your views what you think.

Thanks!

Cheers,
Ram.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon May 31, 2010 9:55 pm
Reply with quote

Hello,

Rather than trying to identify each and every invalid value, suggest the alternative - identify the valid values and change everything else to a space. . .

Then send the map. . .
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon May 31, 2010 10:05 pm
Reply with quote

There are only a few 3270 opcodes, and IIRC, only the SBA is the one that would cause your XPROG error. You might try a simple inspect/replacing on the fields with the junk before/after moving them to the map.
Back to top
View user's profile Send private message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Tue Jun 01, 2010 12:07 pm
Reply with quote

Thanks for your Advise and solution,but the problem stands as it is.

Let me try this :
I'll inspect and move them if they are not alpha or numeric or symbols.

Can this be done?

I'll let you know the challenged I face on the way.

Thanks again.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jun 01, 2010 12:18 pm
Reply with quote

Quote:
I'll inspect and move them if they are not alpha or numeric or symbols.


we cannot tell if it is right or wrong..
the best approach would be to review the application specifications
and for each field/column involved carry on the proper validation

we cannot tell what validations to carry on because we do not know the application specifications
Back to top
View user's profile Send private message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Tue Jun 01, 2010 2:26 pm
Reply with quote

Use 'Is Numeric' clause on the numeric field

Rgds,
Pravesh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jun 01, 2010 8:29 pm
Reply with quote

Hello,

Quote:
Use 'Is Numeric' clause on the numeric field
Why would one do this if the field may contain valid alphanumeric data?

Where in db2 did you find "is numeric"?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jun 01, 2010 9:28 pm
Reply with quote

syed-sameer-ahmed,
are you sure the working-storage area receiving the data is in sync with the DB2 fields ?
If you have FETCH cursorname INTO :GROUP-FIELD and if the fields in the group do not exactly correspond to the DB2 columns, then it may look like junk.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts What database does Jobtrac use CA Products 4
No new posts Capturing COBOL job and program names... All Other Mainframe Topics 2
No new posts Products/Tools to Optimize Adabas Dat... Compuware & Other Tools 2
No new posts Identify unused (junk) REXX scripts TSO/ISPF 30
Search our Forums:

Back to Top