The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Bourne and decimals?? kdyzsa Shell Programming and Scripting 1 05-06-2008 10:54 PM
handle decimals subin_bala Shell Programming and Scripting 1 04-21-2008 08:03 AM
Req on how to convert hex numbers to decimals hare UNIX for Advanced & Expert Users 3 03-21-2008 11:04 AM
EBCDIC to ASCII conv for packed decimals. videsh77 UNIX for Dummies Questions & Answers 3 05-12-2007 01:14 PM
comparing two numbers with the decimals chittari Shell Programming and Scripting 4 06-28-2006 10:57 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-19-2008
mgirinath mgirinath is offline
Registered User
  
 

Join Date: May 2005
Posts: 69
convert Regular decimals to Packed decimals

Hi,

I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round.

If not unix please let me know if any other progrimming language I can use to do this.

Thanks.
  #2 (permalink)  
Old 09-19-2008
drl's Avatar
drl drl is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2007
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 704
Hi.

If you are comfortable in perl, there is this module at http://cpan.org/:
Code:
Convert::IBM390 -- functions for manipulating mainframe data
providing, for example:
Quote:
packeb TEMPLATE LIST

This function is much like Perl's built-in "pack". It takes a list of values and packs it into an EBCDIC record (structure). If called in list context, it will return a list of one element. The TEMPLATE is patterned after Perl's pack template but allows fewer options. The following characters are allowed in the template:
...
P (1) Packed-decimal field with F signs for positive numbers
(sometimes called "unsigned") (default length = 8)
You might also Google for packed decimal unix

I have used a COBOL compiler on Linux: OpenCOBOL - an open-source COBOL compiler ... cheers, drl
  #3 (permalink)  
Old 09-20-2008
fpmurphy's Avatar
fpmurphy fpmurphy is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
There are a number of different types of packed decimals. If you want IEEE 754r:2008 types have a look at the decPacked module in the IBM decNumber library alphaWorks : decNumber : Overview. It is witten in ANSI C.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0