IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare alphanumeric filed with a numeric field


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Sun Feb 25, 2007 1:31 pm
Reply with quote

Hi,

I receive a X(12) field from a MAP and need to compare it with a 9(9)V99 field in a batch job. icon_exclaim.gif icon_exclaim.gif

I was able to compare when the decimal portion (v99) was not there.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Feb 25, 2007 1:47 pm
Reply with quote

A little more clarity is needed.
MAP and batch, please explain?
Compare, how?
Comparing alphanumeric fields with numeric fields is always a gamble, what are you trying to accomplish?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 26, 2007 1:59 am
Reply with quote

Hello,

Please post the CICS field definition that uses the field from the map.

Then, please post the field definition(s) and compare(s) from the batch job.

What does this
Quote:
I was able to compare when the decimal portion (v99) was not there
mean?

Do you get a syntax error, an unexpected answer, or an abend.

Whatever info you get, you need to post it so we can help.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Feb 26, 2007 8:53 am
Reply with quote

Hi Ranga,

What is the range of accepable values that you can receive from the field, for example:

+234.56; $1234.56-; $1,234.56; $1234.56+; 123456-; 1234.56, etc.

You have to solve the edit problem before you can work on the conversion problem.
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Tue Feb 27, 2007 11:35 am
Reply with quote

Hi,

Thanks for asking details.

I am receiving the x(12) fields from a CICS map (into VSAM file) and need to compare it with a 9(9)v99 filed in a QSAM file.

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 27, 2007 8:51 pm
Reply with quote

Hello,

Yes, we understand the input is X(12), however to be much help, we need the answer to
Quote:
What is the range of accepable values that you can receive from the field, for example:

+234.56; $1234.56-; $1,234.56; $1234.56+; 123456-; 1234.56, etc.
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Tue Mar 06, 2007 10:48 am
Reply with quote

I am getting it in the format "1234.56".
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Mar 06, 2007 12:49 pm
Reply with quote

ranga_subham wrote:
I am getting it in the format "1234.56".
Finally...
You need to "de-edit" the field and get the decimal point out.
Enterprise COBOL has an intrinsic function NUMVAL that can do this easily. A little harder is to do it manually, but it can be done.
Will the NUMVAL work for you?
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Tue Mar 06, 2007 2:21 pm
Reply with quote

renga are you getting only numeric value through x(12)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top