Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Junk Value in Database

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 46
Location: Bangalore

PostPosted: Wed May 19, 2010 10:42 pm    Post subject: Junk Value in Database
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Wed May 19, 2010 11:00 pm    Post subject: Reply to: Junk Value in Database
Reply with quote

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

Senior Member


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

PostPosted: Thu May 20, 2010 3:04 pm    Post subject: Re: Junk Value in Database
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: 46
Location: Bangalore

PostPosted: Mon May 31, 2010 6:41 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon May 31, 2010 6:45 pm    Post subject: Reply to: Junk Value in Database
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: 2150
Location: At my coffee table

PostPosted: Mon May 31, 2010 6:57 pm    Post subject:
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: 46
Location: Bangalore

PostPosted: Mon May 31, 2010 6:57 pm    Post subject:
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    Post subject:
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: 46
Location: Bangalore

PostPosted: Mon May 31, 2010 8:12 pm    Post subject:
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: 7904
Location: Bellevue, IA

PostPosted: Mon May 31, 2010 9:22 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon May 31, 2010 9:55 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon May 31, 2010 10:05 pm    Post subject:
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: 46
Location: Bangalore

PostPosted: Tue Jun 01, 2010 12:07 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jun 01, 2010 12:18 pm    Post subject: Reply to: Junk Value in Database
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    Post subject: Reply to: Junk Value in Database
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

Site Director


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

PostPosted: Tue Jun 01, 2010 8:29 pm    Post subject:
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: 1218
Location: Israel

PostPosted: Tue Jun 01, 2010 9:28 pm    Post subject: Reply to: Junk Value in Database
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts Database access from COBOL amitmahalkar DB2 1 Wed Jan 27, 2016 11:33 am
No new posts XML generated from cobol is displayin... vangeti COBOL Programming 2 Wed Aug 19, 2015 5:16 pm
No new posts Database backup on IMS DB HABBIE IMS DB/DC 1 Wed Aug 12, 2015 9:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us