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
 
Comparing alphanumeric with comp-3

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

New User


Joined: 13 Sep 2005
Posts: 18

PostPosted: Tue Jun 27, 2006 2:26 pm    Post subject: Comparing alphanumeric with comp-3
Reply with quote

i am working on web based COBOL Program....my input from web will be collected in variable say DISCOUNT with pic clause X(7)...in the program I WANT TO COMPARE the DISCOUNT from the web with the host variable WS-DISCOUNT with pic clause s9(3)v9(3) comp-3.

SAY....
01 DISCOUNT PIC x(7). let's value be 123.456

my host variable
WS-DISCOUNT PIC S9(3)V9(3) COMP-3

can any one tell me how to compare an alphanumeric with comp-3 variable?
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Jun 27, 2006 3:54 pm    Post subject:
Reply with quote

Hi,

You can use a Redefines clause before compare with the host variable
Back to top
View user's profile Send private message
sumivel

New User


Joined: 13 Sep 2005
Posts: 18

PostPosted: Tue Jun 27, 2006 4:35 pm    Post subject: Re: Comparing alphanumeric with comp-3
Reply with quote

got error when redefine a alphanumeric with comp-3 variable....even if i redefine with 9(3)v9(3) it is taking the decimal point and the last digit is truncated.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Jun 27, 2006 6:07 pm    Post subject:
Reply with quote

Redefine as:

9(3).9(3)
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 Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm
No new posts To get Non matching row after compari... vinu78 DB2 7 Fri Jan 05, 2018 5:43 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Comparing dates in different formats migusd SYNCSORT 4 Sat Nov 18, 2017 3:02 am

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