Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copybook misalignment in fileaid

I am trying to create a copybook structure for my data file.

Part of the data looks like this

          C  0000.00                                                

Since it has 0000.00 , in my copybook, we declared it as a PIC 9(04)v9(02).

but when i map it using fileaid, i get this error

15 EF-PURCH-FEE-AMT           6/AN   0000.0         
15 EF-FILLER4               975/AN   0    

The decimal point is considered as another byte and the last zero is spilling into the subsequent field

I have tried to define the picture clause as zoned decimal by giving value as PIC ZZZ9V99 as well. But its still spilling into next field.

Expected result. :

15 EF-PURCH-FEE-AMT           6/AN   0000.00        
15 EF-FILLER4               975/AN   0

Actual result:

15 EF-PURCH-FEE-AMT           6/AN   0000.0         
15 EF-FILLER4               975/AN   0 

PIC definition as of now:

15  EF-PURCH-FEE-AMT       PIC  ZZZ9V99.   
15  EF-FILLER4                PIC  X(975).  
like image 390
Falcom Avatar asked Jan 27 '23 23:01

Falcom


1 Answers

Please refer to the documentation for the PICTURE clause of a data definition. There you will find that the V is a presumed or virtual decimal point, not a physical one. You may be able to attain your desired result with...

15  EF-PURCH-FEE-AMT PIC 9999.99.
like image 118
cschneid Avatar answered Jan 31 '23 10:01

cschneid