Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Amount field is getting corrupted when Using "LTOU"

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 129
Location: INDIA

PostPosted: Tue Oct 18, 2016 8:20 pm    Post subject: Amount field is getting corrupted when Using "LTOU"
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 18, 2016 8:35 pm    Post subject: Reply to: Amount field is getting corrupted when Using "LTOU"
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

New User


Joined: 29 Apr 2008
Posts: 37
Location: Maryland

PostPosted: Tue Oct 18, 2016 8:35 pm    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Tue Oct 18, 2016 8:40 pm    Post subject:
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: 129
Location: INDIA

PostPosted: Tue Oct 18, 2016 11:05 pm    Post subject: Reply to: Amount field is getting corrupted when Using "LTOU"
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Oct 18, 2016 11:30 pm    Post subject: Reply to: Amount field is getting corrupted when Using "LTOU"
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 22 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us