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
 

 

Compare Numeric and Character

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

New User


Joined: 26 Feb 2006
Posts: 38

PostPosted: Wed Dec 20, 2006 4:15 pm    Post subject: Compare Numeric and Character
Reply with quote

Hi,

I have two variables. One is from the file (Trailer count x(9)). another is a counter that i have in the program 9(7).

counter1 x(9) - value is '000000045'
counter2 9(7) - value is '0000045'

If u compare, both have to be equal logically (45 & 45) but the result says they are different. I hope it does a character comparison since one is character.

Kindly, let me know is there any other alternative.

Regards
SSR
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Dec 20, 2006 4:32 pm    Post subject:
Reply with quote

Hi SSR,

One alternative is to move counter1 to numeric variable if it is numeric & then compare.
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Wed Dec 20, 2006 6:16 pm    Post subject:
Reply with quote

Hi SSR,

The comparision can be done only for compatible data types.
You can redefine the counter1 as
counter1-num redfeines counter1

Then compare counter1-num and counter2. I hope this will work fine.

Sandeep
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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm


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