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
 

 

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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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