Ebcidic to ASCII (Packed decimals are there)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ebcidic to ASCII (Packed decimals are there)
# 8  
Old 10-03-2013
Can you confirm that if the record layout for EVENT-TYPE = 1 can be written as:
Code:
CURR-MAINT-DATE USAGE DISPLAY    PIC S9(7) SIGN IS LEADING SEPARATE CHARACTER. .
 PREV-MAINT-DATE USAGE DISPLAY    PIC S9(7) sign as above. 
PREV-CNCY-CODE            PIC X(03).
 CNCY-CONV-DATE  USAGE DISPLAY    PIC S9(07) sign as above.
 CNCY-CONV-TIME                  PIC  9(07). 
FILLER             PIC X(416)

That is, there is no valid data in the filler.
Also, for EVENT-TYPES 3 through 900, are there other layouts that include packed decimal?
I am puzzled by the date and time fields as they are signed and also that sizes of 8 and 6 respectively would be more appropriate,and require the same amount of disk space. Is there a possibility that they are negative, and if so should these also be changed to leading separate character?

Last edited by jgt; 10-03-2013 at 09:25 AM..
# 9  
Old 10-03-2013
Hi,

Filler contains only spaces and this is just to make sure the length of the record is same irrespective of the EVENT_TYPE.

Date and TIME are packed decimals and there is nothing that we need to round off and all.Just need to pass what we get from source.

Thanks alot for your reply..
# 10  
Old 10-03-2013
I meant CDATE-EVENT and TIME-EVENT, not the sub fields in EVENT-DATA.
# 11  
Old 10-04-2013
Yes the CDATE-EVENT and TIME-EVENT, are the sub fields in EVENT-DATA.
# 12  
Old 10-04-2013
Do you know the file recording mode? Probable modes are fixed record length, no record separator; or fixed record length with record separator.
What operating environment does the file reside in?
If I leave the signed fields without a leading separate character, negative numbers will end in a lower case letter in the units column, so depending upon what you intend to do with the file, you may still have to do more conversion.
Approximately how many records are in the file?
# 13  
Old 10-07-2013
The file is a fixed width without any filed seperator.
The file is not huge approximatly 20k records.
From packed to normal format should be proper ie., we should not remove any signs..
Login or Register to Ask a Question

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

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

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

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

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

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

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

10. 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
Login or Register to Ask a Question