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 alphanumeric filed with a numeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Compare alphanumeric filed with a numeric field
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: 3158
Location: Tucson AZ

PostPosted: Sun Feb 25, 2007 1:47 pm    Post subject:
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

Site Director


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

PostPosted: Mon Feb 26, 2007 1:59 am    Post subject:
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    Post subject:
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    Post subject: Thanks
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

Site Director


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

PostPosted: Tue Feb 27, 2007 8:51 pm    Post subject:
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    Post subject: Re: Compare alphanumeric filed with a numeric field
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: 3158
Location: Tucson AZ

PostPosted: Tue Mar 06, 2007 12:49 pm    Post subject: Re: Compare alphanumeric filed with a numeric field
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: 128
Location: kerala,india

PostPosted: Tue Mar 06, 2007 2:21 pm    Post subject:
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    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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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