View previous topic :: View next topic
|
Author |
Message |
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Hi All,
I am converting an entire file form Lower to uppercase thru below sort card
Code: |
SORT FIELDS=(1,7,CH,A)
OUTREC OVERLAY=(1:1,1600,TRAN=LTOU) |
This file has many fields defined as Binary,Packed Decimal and so on .. I want to convert an alphanumeric value in the file I don't know where it appears and whether it is upper or lower.. So planned to Convert the entire file . after converting I am getting below scenario
Some Amount fields Which are defined as COMP-3 are corrupted and not displayed as ********* in file manager when mapped with copybook.
Code: |
Converted Field
#186
PD 1035:5
<---+----1>
*********** ----> This is Display Value
46C02 -----> These 2 lines are the HEX Value
5791C |
Before conversion
Code: |
FIELD
#186
PD 1035:5
<---+----1>
4567890.12 ----> This is Display Value
46802 These 2 lines are the HEX Value
5791C |
Can we rectify this issue or can we check the lower case and if found then convert it to upper .
Any Help is Much Appreciated. Many Thanks in Advance.
Sumit |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
You should translate ONLY the fields that You know as alphabetics
translating anything else would mean to clobber binary and packed data |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
You are not allowed to include any non-text field (e.g. not PIC X(nnn) ) into your OVERRIDE positions range.
Now you get exactly what you requested. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Well, the system did EXACTLY what you told it to do. The X'89' is a lower case I, and it got converted to an upper case I (x'C9') just as it was supposed to. The fact that the lower case I was in the middle of a packed decimal field didn't matter since you told the system to convert the entire record.
When you have binary or packed decimal fields in your record, you MUST convert each character field individually -- or you will have problems with inappropriate translations (as you have seen). |
|
Back to top |
|
|
thesumitk
Active User
Joined: 24 May 2013 Posts: 156 Location: INDIA
|
|
|
|
Thanks all for your responses and time you spent to help me .. Much appreciated , I will try to find an alternate to complete this task perhaps easytrieve or cobol.
Thanks Again !!
Sumit |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
it will be boring to write the build with the input positions/lengths,
in any case for the other approaches You will have to write the <copybook> for the output
at the end not too much difference ,
probably with sort You will end writing less stuff |
|
Back to top |
|
|
|