Visit Our UNIX and Linux User Community

how to convert data from ASCII to Packed Decimal

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to convert data from ASCII to Packed Decimal
# 1  
Old 05-15-2009
how to convert data from ASCII to Packed Decimal

Hi All,
Please let me know if it is possible to convert data from ASCII to Packed Decimal through Unix?

Basically we have ASCII file with numeric data we want to convert that files data to Packed decimal format to send it to main frame.
Please let me know if we can do it through unix script.

Thanks in advance.


# 2  
Old 05-15-2009
This would be very difficult in shell but easy in a high level language such as Cobol (pic COMP-3).
Common sense says do the conversion on the Mainframe unless you have the tools on the unix server.
There is much variation in Packed Decimal which is further complicated if you need to generate EBCDIC on the unix server.
Binary-coded decimal - Wikipedia, the free encyclopedia
If it is really necessary to do the conversion on the unix server the blunt approach is with a conversion table, though you don't state data volumes or anything about the computers or software involved.

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert Hex to Ascii in a Ascii file

Hi All, I have an ascii file in which few columns are having hex values which i need to convert into ascii. Kindly suggest me what command can be used in unix shell scripting? Thanks in Advance (2 Replies)
Discussion started by: HemaV
2 Replies

2. Programming

Urgent help needed.. C++ program to convert decimal to hexa decimal

Hi , seq can be 0...128 int windex = seq / 8; int bindex = seq % 8; unsigned char bitvalue = '\x01' << (7-bindex) ; bpv.bitmapvalue = bitvalue; This is the part of a program to convert decimal to bitmap value of hexadecimal. I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies

3. Shell Programming and Scripting

Ebcidic to ASCII (Packed decimals are there)

I have a input file which is EBCIDIC and it has packed decimals. Can anyone help me to convert EBCIDIC file to ASCII(Need to convert even Packed decimal values also to normal format) (12 Replies)
Discussion started by: Anusha_Reddy
12 Replies

4. Shell Programming and Scripting

need to convert a decimal value to an ascii char with awk for the field delimiter

Hello, I need an awk script to receive a variable that's an decimal value such as 009 or 031 and then convert this value to an ascii character to use as the FS (field separator for the input file). For example, 009 should be converted to an ascii tab 031 should be converted to an ascii... (1 Reply)
Discussion started by: script_op2a
1 Replies

5. Shell Programming and Scripting

PERL:How to convert numeric values txt file to PACKED DECIMAL File?

Is there any way to convert numeric values txt file to PACKED DECIMAL File using PERL. Regards, Alok (1 Reply)
Discussion started by: aloktiwary
1 Replies

6. Shell Programming and Scripting

convert ascii values into ascii characters

Hi gurus, I have a file in unix with ascii values. I need to convert all the ascii values in the file to ascii characters. File contains nearly 20000 records with ascii values. (10 Replies)
Discussion started by: sandeeppvk
10 Replies

7. UNIX for Dummies Questions & Answers

EBCDIC to ASCII conv for packed decimals.

By using dd command in Unix one can convert EBCDIC file into ASCII. It fails when it comes to having packed decimals within the EBCDIC file. The resultant of it has garbage chars. How can we have EBCDIC file convertedinto ASCII, which has packed decimal data in it? Thanks in advance. (3 Replies)
Discussion started by: videsh77
3 Replies

8. UNIX for Advanced & Expert Users

Convert Binary data to ascii data

Friends, I've tried on solaris, but I could n't get ascii data dd if=binaryinputfile bs=1 skip=3800 count=4 | od -t u4 output : INDBU3:/usr/users/FTAMUSER/kk $ dd if=SMP20041006173649188151 bs=1 skip=3800 count=4 | od -t u4 4+0 records in 4+0 records out 0000000 0000000000 0000004... (4 Replies)
Discussion started by: krishna
4 Replies

9. UNIX for Dummies Questions & Answers

Packed Decimal

How do we create a text file with COBOL "Packed Decimal" value in UNIX ? (1 Reply)
Discussion started by: gaddeg
1 Replies

10. UNIX for Dummies Questions & Answers

Convert "text" to "packed-decimal"?

Is there a way with HP-UX Release 10.20 (but going to HP-UX 11) to convert a regular "text" file to a packed data format (such as is created by a Cobol program)? (2 Replies)
Discussion started by: HuskyJim
2 Replies

Featured Tech Videos