Anyone know how to convert a string into Cobol packed decimal format (comp-3)?

ajruiz

New member
Joined
Oct 14, 2005
Messages
1
Location
MN
Programming Experience
5-10
I'm developing an application that needs to convert a string into packed decimal format. The string to be converted is 11 chars, decimal point, then 2 chars (###########.## decimal as a string basically).I need to convert to Cobol type comp-3 to input into an old mainframe system; Does anyone have any ideas on this? Thanks
 
decimal is comp-3 datatype equivalent

I believe the "decimal" datatype is the equivalent to comp-3.

try converting the string to decimal. eg.

Dim test As Decimal
Try
test = Convert.ToDecimal(TextBox3.Text)
Catch ex As Exception

End Try


I would also suggest testing if the text is numeric at some point. There are a lot of error detection procedures that could be performed here, It is your prerogative.

perhaps that will help
 
Back
Top