Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us