Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Check if file is EBCDIC or ASCII format Post 303012210 by wbport on Wednesday 31st of January 2018 04:34:53 PM
Old 01-31-2018
Packed decimal has little to do with EBCDIC or ASCII. Each byte contains two decimal digits except the last byte may contain a sign like x'C' for positive, x'D' for negative, and x'F' for unsigned.
In COBOL, a signed five digit field would be represented with
Code:
77  FIELD-NAME   PIC S9(5) COMP-3.

and would occupy three bytes. In hex, the number -12345 would be x'12 34 5D'.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check whether a given file is in ASCII format and data is tab-delimited

Hi All, Please help me out with a script which checks whether a given file say abc.txt is in ASCII format and data is tab-delimited. If the condition doesn't satisfy then it should generate error code "100" for file not in ASCII format and "105" if it is not in tab-delimited format. If the... (9 Replies)
Discussion started by: Mandab
9 Replies

2. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like ..ݡ.ݡ ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies

3. Shell Programming and Scripting

How to convert ebcdic file to ascii file?

How to convert ebcdic file to ascii file? (1 Reply)
Discussion started by: superuser123
1 Replies

4. UNIX for Dummies Questions & Answers

How to convert ebcdic file to ascii file?

How to convert ebcdic file to ascii file? (1 Reply)
Discussion started by: superuser123
1 Replies

5. Shell Programming and Scripting

How to check if the file has EBCDIC or ascii characters

Hi, is there a way to check if the initial few characters are ebcdic or ascii in a file? (1 Reply)
Discussion started by: ahmedwaseem2000
1 Replies

6. UNIX for Dummies Questions & Answers

Help! EBCDIC format to ASCII

Hi everyone, I have a 70MB EBCDIC file, with record length 102, block size 32742 and IBM standard label. I commanded dd if=input file of=outputfie ibs=32742 cbs=102 conv=ascii but I still don't get a viewable file under ASCII. Can anyone told me what's the problem? Do I need... (12 Replies)
Discussion started by: hrchl86
12 Replies

7. Shell Programming and Scripting

EBCDIC Format to ASCII

Hi, we have source file with EBCDIC format(Main Frame files) where we receving from source system. I would like to convert the EBCDIC format file to unix systemformat(ex: .csv,txt ) I have wrote script like: dd if=<SRCPATH>yyy.xxx.RB065 of=<SRCPATH>/output.csv ibs=800 cbs=80... (8 Replies)
Discussion started by: koti_rama
8 Replies

8. Red Hat

Unable to convert EBCDIC file to ASCII file

Hello all, To give you all a little bit of background. We recently migrated from HP-UX to Redhat Linux and one of the command I used to run on HP-UX to convert an EBCDIC file to ASCII file isn't working on Linux. The code is as follow: cat workout2.dat | dd cbs=250 conv=block conv=ascii... (3 Replies)
Discussion started by: sethmj
3 Replies

9. Programming

Ebcdic to ascii

Hi, I want to convert ebcdic values to ascii values. Are there anyany specific c++ libraries with g++ compiler, which can do it ? gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) (19 Replies)
Discussion started by: tostay2003
19 Replies

10. UNIX for Beginners Questions & Answers

Convert EBCDIC(.DAT) FILE into ASCII FILE

Hi Team, I am having 100 EBCDIC files (i.e. DAT extension) and need to convert them into ASCII File by unix shell script. I tried with DD Command but its not providing output as expected. Sample Text: ------------------ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Expected Output:... (2 Replies)
Discussion started by: JSM
2 Replies
OD(1)							    BSD General Commands Manual 						     OD(1)

NAME
od -- octal, decimal, hex, ASCII dump SYNOPSIS
od [-aBbcDdeFfHhIiLlOosvXx] [-A base] [-j skip] [-N length] [-t type] [[+]offset[.][Bb]] [file ...] DESCRIPTION
The od utility is a filter which displays the specified files, or standard input if no files are specified, in a user specified format. The options are as follows: -A base Specify the input address base. base may be one of d, o, x or n, which specify decimal, octal, hexadecimal addresses or no address, respectively. -a Output named characters. Equivalent to -t a. -B, -o Output octal shorts. Equivalent to -t o2. -b Output octal bytes. Equivalent to -t o1. -c Output C-style escaped characters. Equivalent to -t c. -D Output unsigned decimal ints. Equivalent to -t u4. -e, -F Output double-precision floating point numbers. Equivalent to -t fD. -f Output single-precision floating point numbers. Equivalent to -t fF. -H, -X Output hexadecimal ints. Equivalent to -t x4. -h, -x Output hexadecimal shorts. Equivalent to -t x2. -I, -L, -l Output signed decimal longs. Equivalent to -t dL. -i Output signed decimal ints. Equivalent to -t dI. -j skip Skip skip bytes of the combined input before dumping. The number may be followed by one of b, k or m which specify the units of the number as blocks (512 bytes), kilobytes and megabytes, respectively. -N length Dump at most length bytes of input. -O Output octal ints. Equivalent to -t o4. -s Output signed decimal shorts. Equivalent to -t d2. -t type Specify the output format. type is a string containing one or more of the following kinds of type specifiers: a Named characters (ASCII). Control characters are displayed using the following names: 000 NUL 001 SOH 002 STX 003 ETX 004 EOT 005 ENQ 006 ACK 007 BEL 008 BS 009 HT 00a NL 00b VT 00c FF 00d CR 00e SO 00f SI 010 DLE 011 DC1 012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB 018 CAN 019 EM 01a SUB 01b ESC 01c FS 01d GS 01e RS 01f US 020 SP 0ff DEL c Characters in the default character set. Non-printing characters are represented as 3-digit octal character codes, except the following characters, which are represented as C escapes: NUL alert a backspace  newline carriage-return tab vertical tab v Multi-byte characters are displayed in the area corresponding to the first byte of the character. The remaining bytes are shown as '**'. [d|o|u|x][C|S|I|L|n] Signed decimal (d), octal (o), unsigned decimal (u) or hexadecimal (x). Followed by an optional size specifier, which may be either C (char), S (short), I (int), L (long), or a byte count as a decimal integer. f[F|D|L|n] Floating-point number. Followed by an optional size specifier, which may be either F (float), D (double) or L (long double). -v Write all input data, instead of replacing lines of duplicate values with a '*'. Multiple options that specify output format may be used; the output will contain one line for each format. If no output format is specified, -t oS is assumed. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of od as described in environ(7). DIAGNOSTICS
The od utility exits 0 on success, and >0 if an error occurs. COMPATIBILITY
The traditional -s option to extract string constants is not supported; consider using strings(1) instead. SEE ALSO
hexdump(1), strings(1) STANDARDS
The od utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
An od command appeared in Version 1 AT&T UNIX. BSD
July 11, 2004 BSD
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy