Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
HEX VALUES

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Fri Dec 05, 2003 7:19 am    Post subject: HEX VALUES
Reply with quote

What is the difference between Character and HEX Values.

We have an address field X(32). It may contain proper value or some junk like X'0000'. We need to seperate out those records having junk values in the Address field.

Your help will be appreciated.

Regards,
Sandip.
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Dec 08, 2003 1:11 pm    Post subject:
Reply with quote

Hi Sandip,

Check out the CLASS clause in the SPECIAL-Names pgraph of the CONFIGURATION SECTION of the ENVIRONMENT DIVISION.

You can create a CLASS that contains all the chars that you deem acceptable. Then, in the proc div you can code a CLASS test to determine that your 32 byte field only contains those acceptable chars.

Example: Define a CLASS as "ACCEPTABLE"

In the proc div, code:
Code:

IF FLD-32 IS ACCEPTABLE
    PERFORM PROCESS-FLD
ELSE
    PERFORM BY-PASS-FLD
END-IF

One cautionary note. When using the THRU feature in defining the CLASS, remember that 'A' THRU 'Z' defines all chars with bit configurations between X'C1' and X'E9'. That means that there are gaps between "I" and "J", "R" and "S" that contain values that are not alphabetic.

Take a look at Appendix B of the COBOL Reference Manual. It contains the EBCDIC & ASCII collating sequences, you'll see what I mean.

Regards, Jack.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Mon Dec 08, 2003 1:26 pm    Post subject:
Reply with quote

Hi Jack,

It may seem to be ridiculas to you but I don't know the possible junk characters in the field.

Regards,
Sandip.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 10, 2003 12:42 pm    Post subject:
Reply with quote

Hi Sandip,

Do you know what the valid chars can be?

Regards, Jack.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Tue Dec 16, 2003 6:29 pm    Post subject:
Reply with quote

Hi Jack,

It may be anything A-Z, a-z, 0-9.

Regards,
Sandip.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Dec 18, 2003 3:38 am    Post subject:
Reply with quote

Hi Sandip,

Try this:
Code:

        ENVIRONMENT DIVISION.
        SPECIAL NAMES.
            ACCEPTABLE IS
                '0' THRU '9'
                'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
                'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
                'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
                'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'.


Use the PROC DIV code I listed in a previous post. The IF stmt will PERFORM the code that will process the field if it ONLY contains the chars listed above. If your testing shows that the list doesn't contain ALL the acceptable chars just expand the list.

Regards, Jack.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts attchmvs from rexx subroutine that re... harisukumaran CLIST & REXX 1 Fri Jan 19, 2018 5:29 am
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 1 Tue Sep 12, 2017 1:42 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us