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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm


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