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

Translate alphanumeric '2345' into char 'ABCD'


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Nov 13, 2008 10:59 am
Reply with quote

I want to translate alphanumeric '2345' into char 'ABCD', how to do it in easytrieve?

I try to define in working storage like that:

AA_RECORD 01 04 A

BB_RECORD 01 04 A
BB_RECORD_01 BB_RECORD 01 N
BB_RECORD_02 BB_RECORD +1 01 N
BB_RECORD_03 BB_RECORD +1 01 N
BB_RECORD_04 BB_RECORD +1 01 N

BB_RECORD_01 = 'A' + (BB_RECORD_01 - 1)

Unfortunately, I got error message '*******B055 INVALID LENGTH, TYPE OR DECIMAL PLACES - BB_RECORD_01'

do anybody know this situation?
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: Thu Nov 13, 2008 11:09 am
Reply with quote

Hello,

To do what i believe you want, you do not need to calculate anything.

Just compare the "input" field for '2345' and if it is equal move 'ABCD' to the "output" field.

Possibly there is something i do not understand icon_confused.gif
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Nov 13, 2008 11:12 am
Reply with quote

Sorry for the confusion.

I really need to do the calculation, like we get value 1 in the first posion.
after the conversion, we would get value 'B' since 'A' + 1 is 'B'.

could we do that via the easytrieve?
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: Thu Nov 13, 2008 11:22 am
Reply with quote

Hello,

Does this mean that the original 4-char values are not actually part of the requirement? There is no relation between 2345 and ABCD, or is there?

I believe you need to post much more complete examples of what data might arrive as input and how it should be converted for output.

What "rule" says that an input 1 should result in the calculaton of A + 1? What is the rule if an R is input? What if the input is zero or 9?
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Nov 13, 2008 11:28 am
Reply with quote

all right.

the rule is when we get input value 2, after the calculation H - ( 2 - 1 ) , we would get value G,

when input value is 5, after the calculation H - ( 5 - 1), we get value D

so '1234' we get output 'GFED'. please ignore the previous value 'ABCD'
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: Thu Nov 13, 2008 11:45 am
Reply with quote

Hello,

We are definitely circling around and around. . .

How could we have known or even guessed that we needed to grab an H to use in the calculation?

You need to clearly post all of the rules or you need to post a set of tables that show all of the value combinatoins.

I'll check back later - gong to be away for a while.
Back to top
View user's profile Send private message
kennedy_zhu

New User


Joined: 30 Nov 2007
Posts: 27
Location: China

PostPosted: Thu Nov 13, 2008 11:56 am
Reply with quote

ok.

rule is output letter = N - (input letter - 1)

table is following ->

input 1 2 3 4 5 6 7 8 9 0

output N M L K J I H G F O
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Nov 13, 2008 12:04 pm
Reply with quote

kennedy,

The "rule" in your previous post was something like
Quote:
output letter = H - (input number - 1)

Now your latest post says
Quote:
output letter = N - (input letter - 1)

But still your input is a number and not a letter. I m confused icon_rolleyes.gif
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
No new posts Cobol Db2 program (inserting Char Equ... COBOL Programming 0
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top