View previous topic :: View next topic
|
Author |
Message |
syed-sameer-ahmed Warnings : 2 New User
Joined: 22 Feb 2007 Posts: 45 Location: Bangalore
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What are "junk values" and how did they get there? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
define junk values |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
syed-sameer-ahmed Warnings : 2 New User
Joined: 22 Feb 2007 Posts: 45 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
I want to handle this condition in the program and replace the junk value bu space. |
ok go ahead... where is the problemc |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
This is a CICS BMS problem, validate the data before putting it in a map. |
|
Back to top |
|
|
syed-sameer-ahmed Warnings : 2 New User
Joined: 22 Feb 2007 Posts: 45 Location: Bangalore
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
syed-sameer-ahmed Warnings : 2 New User
Joined: 22 Feb 2007 Posts: 45 Location: Bangalore
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
geekram
New User
Joined: 09 May 2010 Posts: 4 Location: Mumbai, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
syed-sameer-ahmed Warnings : 2 New User
Joined: 22 Feb 2007 Posts: 45 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
Pravesh
New User
Joined: 30 Jul 2009 Posts: 32 Location: Gurgaon
|
|
|
|
Use 'Is Numeric' clause on the numeric field
Rgds,
Pravesh |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
|