what is X'82' or X'80'



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: what is X'82' or X'80'

Postby Akatsukami » Fri Dec 16, 2011 12:21 am

rajufis_01 wrote:thank you for reply nic,
for example i am adding a record to a file it should not allow special charecaters( like*,&,%...),how can a keep a condition to avoid this situation can u please help me out

You don't seem to have clearly thought out your needs here:

  1. Is your record solely character data? Unlike toy computers, mainframes often use non-character data.

    For example, suppose you have a field declared S9(4) COMP-5 and wrote the decimal value -32,528 to it. That would be X'80F1'.
  2. What should happen in an invalid value is found? Abend, non-zero return code with or without immediate termination of the program, error messages to SYSPRINT or an audit report, sidetracking the bad record to a discard data set, or quietly dropping it? (If the last, this may well be the last program you'll write in that shop.
  3. All the things that I've forgotten, but that other senior people reading these fora will be happy to point out.
Tell us a little about your design. You do have a design document, yes?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Re: what is X'82' or X'80'

 

Re: what is X'82' or X'80'

Postby dick scherrer » Fri Dec 16, 2011 2:55 am

Hello,

i am still confusing with x'82' here i am posting the code
IF DZ0J1-SELIN NOT EQUAL '_' AND SPACE AND X'82'

can you please explain what X'82' will do???
It won't "do" anything. What happens as a resullt of the compare will depend on the value in DZ0J1-SELIN.

If you look at code immediately before and after this part of a line of code, it should help you understand what this particular line of code accomplishes.

Suggest you re-read your entire topic and realize that your original question is not actually related to what you need to learn.

For specific data rules on your system, you will get the best answers from people already familiar with the code/data.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: what is X'82' or X'80'

Postby BillyBoyo » Fri Dec 16, 2011 4:18 am

rajufis_01 wrote:[...]
for example i am adding a record to a file it should not allow special charecaters( like*,&,%...),how can a keep a condition to avoid this situation can u please help me out
[...]


IF DZ0J1-SELIN NOT EQUAL '_' AND SPACE AND X'82'


In the IF, only the Underscore would normally be considered a "special character", although you have to be really careful about such terms. If you don't have a list of what is to be considered a "special character" in your particular case, get one. Why the X'82' (lowercase b) would be "special" or the SPACE I certainly don't have a clue. Maybe this line of code is testing a flag/indicator on a record to see whether it should be SELected for processing. As Dick has said, the code around the IF in question should give you answers to that, and we can't see the code.

If you have a lump of data which you put on one particular output file only if that contains a subset of possible byte values (for instance letters, numbers and spaces) there are a number of ways to do it. As Mr Akatsukami has pointed out, you also need to know what to do when the criteria are not met.

If you can give us more information, we can provide better help.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Previous

Return to IBM Cobol