Sponsored Content
Top Forums Shell Programming and Scripting Ebcidic to ASCII (Packed decimals are there) Post 302858731 by drl on Tuesday 1st of October 2013 08:43:35 AM
Old 10-01-2013
Hi.

A few thoughts:

1) Write a COBOL program to read the records in the native format and write ASCII format.

2) Use perl to convert files, using something like the perl module Convert::IBM390 -- functions for manipulating mainframe data:
Quote:
Convert::IBM390 supplies various functions that you may find useful when working with IBM System/3[679]0 data. No functions are exported automatically; you must ask for the ones you want. "use ... qw(:all)" exports all functions.

By the way, this module is called "IBM390" because it will deal with data from any mainframe operating system. Nothing about it is specific to z/OS, or z/VM, z/VSE, i5/OS, z/TPF....

When transmitting EBCDIC data to your Perl environment via FTP, be sure to use the "binary" option. This will leave the data unconverted so that the module recognizes it. By default, FTP will translate the data to ASCII; this will convert the character fields correctly but garble other formats, such as packed-decimal and binary.
...
unpackeb TEMPLATE RECORD

This function is much like Perl's built-in "unpack". It takes an EBCDIC record (structure) and unpacks it into a list of values. If called in scalar context, it will return only the first unpacked value. The TEMPLATE is patterned after Perl's unpack template but allows fewer options.
-- The CPAN Search Site - search.cpan.org

If you don't want to or cannot write such codes:

3) Google for software or services to help. I think I did a search like that last year, and most of the hits were for proprietary products and services.

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

ebcidic file coversion to ascii

I want to convert an ebcidic( variable length) file to ascii. Is it possible to do it using a unix scripting.if so, how (7 Replies)
Discussion started by: rintingtong
7 Replies

3. Shell Programming and Scripting

EBCIDIC to ASCII

can anyone get a script for converting EBCIDIC data to Unix ina file.. in shell... thanks in advance! (3 Replies)
Discussion started by: bourne
3 Replies

4. 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

5. Shell Programming and Scripting

conversion of EBCIDIC to ASCII format

Hi all, I need help on above said subject. I have a flat file which is in EBCDIC format,i want to convert into ASCII fromat using 'MFSORT'. file contains COMP-3 value in some positions. Can you please provide the SCRIPT SYNTAX.(assume that file is of 80 byte length and it is having COMP-3... (2 Replies)
Discussion started by: vijayakumarg
2 Replies

6. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: mgirinath
2 Replies

7. UNIX for Dummies Questions & Answers

Viewing Ebcidic files

I am having trouble viewing these files from my unix session. vi comes back with line too long. Also an m_dump with the relevant dml comes back with problems. How can I view this as a text file? Also is there an easy way to view specific records within. Eg I have a policy id (4 Replies)
Discussion started by: trek88
4 Replies

8. Shell Programming and Scripting

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.... (1 Reply)
Discussion started by: aloktiwary
1 Replies

9. UNIX for Dummies Questions & Answers

applying unix command in EBCIDIC file

Hi, I'm having a general query. If we do cat <file name> on a Ebcidic format file then many unknown characters are displayed in my screen. Can we change the character set related to EBCIDIC in session level and apply the cat command on a EBCIDIC file? By doing so can we able to see the... (2 Replies)
Discussion started by: poova
2 Replies

10. 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
File::Spec::Native(3pm) 				User Contributed Perl Documentation				   File::Spec::Native(3pm)

NAME
File::Spec::Native - Use native OS implementation of File::Spec from a subclass VERSION
version 1.003 SYNOPSIS
# This serves little purpose on its own but can be useful in some situations # For example: use Path::Class 0.24; # convert foreign file type into native type # without having to know what the current OS is foreign_file(Win32 => $win32_path)->as_foreign("Native"); # or to build a file-spec dynamically (possibly taking the type from input): my $type = get_requested_file_spec(); # can return "Native" foreign_file($type => $file_path); # having $type be "Native" is an alternative to having to do: my $file = $type ? foreign_file($type, $file_path) : file($file_path); DESCRIPTION
This module is a stupid hack to make the default File::Spec behavior available from a subclass. This can be useful when using another module that expects a subclass of File::Spec but you want to use the current, native OS format (automatically detected by File::Spec). For example: "as_foreign" in Path::Class (as of version 0.24) allows you to translate a Path::Class object from one OS format to another. However, there is no way to specify that you want to translate the path into the current, native OS format without guessing at what that format is (which may include peeking into @File::Spec::ISA). This module @ISA File::Spec. SEE ALSO
o File::Spec o Path::Class o <https://rt.cpan.org/Ticket/Display.html?id=49721> SUPPORT
Perldoc You can find documentation for this module with the perldoc command. perldoc File::Spec::Native Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. o Search CPAN The default CPAN search engine, useful to view POD in HTML format. http://search.cpan.org/dist/File-Spec-Native <http://search.cpan.org/dist/File-Spec-Native> o RT: CPAN's Bug Tracker The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Spec-Native <http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Spec-Native> o CPAN Ratings The CPAN Ratings is a website that allows community ratings and reviews of Perl modules. http://cpanratings.perl.org/d/File-Spec-Native <http://cpanratings.perl.org/d/File-Spec-Native> o CPAN Testers The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions. http://www.cpantesters.org/distro/F/File-Spec-Native <http://www.cpantesters.org/distro/F/File-Spec-Native> o CPAN Testers Matrix The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. http://matrix.cpantesters.org/?dist=File-Spec-Native <http://matrix.cpantesters.org/?dist=File-Spec-Native> o CPAN Testers Dependencies The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. <http://deps.cpantesters.org/?module=File::Spec::Native> Bugs / Feature Requests Please report any bugs or feature requests by email to "bug-file-spec-native at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Spec-Native <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Spec-Native>. You will be automatically notified of any progress on the request by the system. Source Code http://github.com/rwstauner/File-Spec-Native <http://github.com/rwstauner/File-Spec-Native> git clone http://github.com/rwstauner/File-Spec-Native AUTHOR
Randy Stauner <rwstauner@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Randy Stauner. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-07-14 File::Spec::Native(3pm)
All times are GMT -4. The time now is 06:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy