View previous topic :: View next topic
|
Author |
Message |
mrdilipchand
New User
Joined: 20 Feb 2007 Posts: 12 Location: banglore
|
|
|
|
Hi all,
In my cobol program i have a condition like
IF NCC-PREF-VAL-CD = SPACES OR LOW-VALUES or HIGH-VALUES
CONTINUE
ELSE
PERFORM 2002-PROCESS-INPUT THRU 2002-EXIT
END-IF.
NCC-PREF-VAL-CD field which i get from input file. i need to check that field to process record. even though there is junk data input file, 2002-PROCESS-INPUT is getting process.
is there any case, can a field contains other than spaces/low/high values which are junk datas. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
mrdilipchand wrote: |
is there any case, can a field contains other than spaces/low/high values which are junk datas. |
For a each character position in a field there are 256 possible values. Space, high-values, and low-values are just 3 of those, of the other 253 possiblities you whould have to decide what else is JUNK and what is valid! |
|
Back to top |
|
|
mrdilipchand
New User
Joined: 20 Feb 2007 Posts: 12 Location: banglore
|
|
|
|
Acutally there are low-values(like >>H) in my input file for the specified field.But the condition is not getting satisfied and it is going to 2002-process-input para which shouldnt be executed |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
mrdilipchand wrote: |
IF NCC-PREF-VAL-CD = SPACES OR LOW-VALUES or HIGH-VALUES |
If NCC-PREF-VAL-CD length is greater than 1 your test will fail if it contains a mix of characters. You are not testing to see if contains any spaces or any low-values or any high-values you are testing to see if it contains all spaces or all low-values or all high-values! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Acutally there are low-values(like >>H) |
Those are not low-values (they are not high-values either).
If you look at your data in tso/ispf with HEX ON and post a bit of it here (using the "Code" tab near the top of the reply panel), we can explain what is in you data. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
I wish you guys would stop calling that data "junk".
Suppose you wrote your yearly salary amount (rounded to the nearest dollar) to a file, and you saw this:
@
That is not "junk" my friend. You just made $1,234,567 this year. |
|
Back to top |
|
|
salman.ahmed
New User
Joined: 06 Dec 2007 Posts: 1 Location: India
|
|
|
|
Hi i checked with a variable of alphanumeric or numeric nature ... in hex format the value for low-value being passed is 00000 and for high-values being passed is fffff there the junk value cannot be either of the twos it is performing the else procedure..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello salman.ahmed and welcome to the forums,
Quote: |
Hi i checked with a variable of alphanumeric or numeric nature ... in hex format the value for low-value being passed is 00000 and for high-values being passed is fffff there the junk value cannot be either of the twos it is performing the else procedure..... |
Most often "junk" is neither high- or low-values. It is usually some hex value (see Jack's previous post) that is either unexpected or unwanted.
When unexpected values are encountered, seeing the value(s) in hex often helps understand what they are. If you post the values (in hex) we can help explain them. |
|
Back to top |
|
|
|