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
 

 

How can we compare one char with another char alphabet

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

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Thu Mar 13, 2008 3:50 pm    Post subject: How can we compare one char with another char alphabet
Reply with quote

10 abc-x pic x occurs 24 times.

10 xyz-x pic x occurs 24 times.

these two arrays can contain alphabets a,b,c,d...soo.. also 0,1,2,3,...
my requirement is to build another array which is having a bad history, means greater value has to be captured...

Plz advice!
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Mar 13, 2008 3:56 pm    Post subject:
Reply with quote

Are you referring this?

Code:
IF abc-x(i) > xyz-x(i) THEN
...put in another array...


Please add some more info on this.
Back to top
View user's profile Send private message
advith001

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Thu Mar 13, 2008 4:45 pm    Post subject:
Reply with quote

yes,

see the data;
80868939001165701D0432100000BBBBBBBBBBBBB20070627
80868939001165799LLLL321000EEEE0EE00EEEEE20020115

The underlined data is the string of array.. I shud compare both the data and put it in another array...
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Mar 13, 2008 4:50 pm    Post subject:
Reply with quote

Comparison on what basis???
Have to be sorted order???
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 216
Location: India

PostPosted: Thu Mar 13, 2008 4:53 pm    Post subject:
Reply with quote

advith001 wrote:
yes,

see the data;
80868939001165701D0432100000BBBBBBBBBBBBB20070627
80868939001165799LLLL321000EEEE0EE00EEEEE20020115

The underlined data is the string of array.. I shud compare both the data and put it in another array...


can u provide us the actual requirement so that we can help u.
Back to top
View user's profile Send private message
advith001

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Thu Mar 13, 2008 5:47 pm    Post subject:
Reply with quote

abc-x pic x occurs 24 times -- value is D0432100000BBBBBBBBBBBBB
xyz-x pic x occurs 24 times -- value is LLLL321000EEEE0EE00EEEEE
pqr-x pic x occurs 24 times -- result of comparison

if abc-x(i) > xyz-x(i)
Move abc-x(i) to pqr-x(i)
else
move xyz-x(i) to pqr-x(i).

I can do this.. but the reulst is L0433210000EEE0EE00EEEEE

considering number is greater than alphabets.. but in my senario, 0 is the least and Z is the highest value I mean 0123456789abcd...z (a is greater than 0 to 9)

Hope this is more clreat abt my req..

Thanks guys in advance...
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Thu Mar 13, 2008 6:02 pm    Post subject: Reply to: How can we compare one char with another char alph
Reply with quote

The results are coming like this b'coz: Hex valule of the Number is greater than that of the character.
eg: 0(X'F0') > A(X'C1')

-Ajay
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Mar 13, 2008 6:10 pm    Post subject:
Reply with quote

well, here is another example of plan without planning.

a is not greater than 0. so simple comparisions are not going to work.

suggest that you have a conversion table.

01 in-val.
05 filler pic x( )
value '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
01 out-val.
05 filler pic x( )
value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'.

then before your compare:
move abc-x(i) to abc-value
move xyz-x(i) to xzy-value
convert abc-value with in-val/out-val (0 would become an A, A>K)
convert xyz-value same

that way abc-x(i) = 0, abc-value would be A
xyz-x(i) = A, xzy-value would be K

thus
IF abc-value < xzy-value
move abc-x(i) to pqr-x(i)
else
move xzy-x(i) to pqr-x(i)
Back to top
View user's profile Send private message
advith001

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Thu Mar 13, 2008 7:48 pm    Post subject:
Reply with quote

Dick, this makes sence! Thank you.. I would try this tomorrow! icon_smile.gif
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 Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


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