answersLogoWhite

0


Best Answer

convert alphanumeric to numeric

data definitions required

convert-this w 5 a

convert-this-num convert-this 5 n 0

convert-this-byte convert-this 1 a occurs 5 index ctb-x

this-packed w 3 p 0

error-flag 1 1 a

procedure is

error-flag = 'x'

ctb-x = 0

do-while ctb-c < 5

case convert-this-byte

value numeric

error-flag = error-flag

*or any other null action

value ' '

convert-this-byte = '0'

* if there are valid characters that need to be converted - test for them and convert them, in my day it was spaces to the left convert to zero blindly

otherwiese

error-flag = 'y'

end-case

ctb-x = ctb-x + 1

end-do

if error-flag = 'y'

*define an error routine and execute it

else

this-packed = convert-this-num

* move the field to the resulting packed field "this-packed"

end-if

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you convert alphanumeric to packed decimal in easytrieve?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the relationship between the IRA character code and the packed decimal representation?

As IRA used 8 bits per character . IRA characters are compatible with packed decimal .


What is packed decimal?

Packed decimal is a method used in computing to store more in less space. A bit of theory here. Characters are stored in binary in their ASCII representation, such that the number 1 = ascii 49 (decimal). Packed decimal means you can store two numbers (numbers only) in the same space, so that ascii 49 = numbers 4 and 9. There is overhead so it is always a trade off between space and computing. And storage is cheap these days


What is packed decimal in cobol?

In Cobol, they had a serious concern for memory size. So they came up with a method known as BCD (Binary Coded Decimal), where a decimal value was converted to binary to save space. Check this link out. It will break down the details.


What is the difference between packed bcd and unpacked bcd?

BCD:A byte (unpacked) representation of a decimal digit in the range0 through9. Unpacked decimal numbers are stored as unsigned byte quantities. Onedigit is stored in each byte. The magnitude of the number is determined fromthe low-order half-byte; hexadecimal values 0-9 are valid and areinterpreted as decimal numbers. The high-order half-byte must be zero formultiplication and division; it may contain any value for addition andsubtraction.Packed BCD:A byte (packed) representation of two decimal digits, each in the range0 through 9. One digit is stored in each half-byte. The digit in thehigh-order half-byte is the most significant. Values 0-9 are valid in eachhalf-byte. The range of a packed decimal byte is 0-99.


Is packed quickly a verb?

&quot;Packed quickly&quot; is a phrase consisting of an adverb (&quot;quickly&quot;) and a verb (&quot;packed&quot;). The verb in this phrase is &quot;packed,&quot; which describes the action being performed.


How are fragile materials are packed?

why plahile material packed


Explain various types of data formats that the 8087 is design to work with?

The 8087 Math CoProcessor can work with two data formats: temporary real and packed decimal. Each data instruction, whether real or decimal, can be up to 80 bits long.


Does Disneyland get packed on Fourth of July?

Yes it is always packed


How tightly packed the atoms are an object?

it is packed 900 demerios


When was Action Packed created?

Action Packed was created in 1988.


What is the homophone packed?

A homophone for &quot;packed&quot; is &quot;packed.&quot; Both words are spelled and pronounced the same but have different meanings.


What is a packed sphere of snow?

a packed sphere of snow is called a 'snowball"