Page 2 of 2

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

PostPosted: Fri Dec 16, 2011 12:21 am
by Akatsukami
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?

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

PostPosted: Fri Dec 16, 2011 2:55 am
by dick scherrer
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.

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

PostPosted: Fri Dec 16, 2011 4:18 am
by BillyBoyo
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.