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
 

 

Translate alphanumeric '2345' into char 'ABCD'

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Translate alphanumeric '2345' into char 'ABCD'
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

Site Director


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

PostPosted: Thu Nov 13, 2008 11:09 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Nov 13, 2008 11:22 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Nov 13, 2008 11:45 am    Post subject:
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    Post subject:
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: 2239
Location: @my desk

PostPosted: Thu Nov 13, 2008 12:04 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products 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
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
No new posts conversion from char to packed decimal Musab Ahmed DFSORT/ICETOOL 7 Fri Apr 08, 2016 1:12 pm
No new posts alphanumeric sequence generation sivaprasad.gadhi COBOL Programming 6 Wed Mar 30, 2016 3:03 am


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