IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Amount field is getting corrupted when Using "LTOU"


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Oct 18, 2016 8:20 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Oct 18, 2016 8:35 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Tue Oct 18, 2016 8:35 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 18, 2016 8:40 pm
Reply with quote

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
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Tue Oct 18, 2016 11:05 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Oct 18, 2016 11:30 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
Search our Forums:

Back to Top