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
 
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am

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