View previous topic :: View next topic
|
Author |
Message |
Narismha
New User
Joined: 22 Nov 2006 Posts: 23 Location: Mumbai
|
|
|
|
Hi,
I have a Focus program to convert that into COBOL language.
I am facing problem in conversion of data types.
Focus MFD ( Master file description):
SEGNAME='CONTR_ER',SEGTYPE=S0,$
FIELD=AA_NBR ,AA_NBR ,I9 ,I4 ,MISSING=OFF,$
FIELD=BB_NBR ,BB_NBR ,I9 ,I4 ,MISSING=OFF,$
FIELD=SDD_NBR ,SDD_NBR ,P11.0 ,P5 ,MISSING=OFF,$
I want cobol data types for the above structure.
like ...
01 FOCUS-COB.
05 AA-NBR PIC 9(9).
05 BB-NBR PIC 9(9).
05 SDD-NBR PIC -------????
Here my question is what is P11.0 in Focus and what is data type in Cobol.
Please help me asap.
Thanks
-Narisimha |
|
Back to top |
|
|
h.dinesh
New User
Joined: 06 Dec 2006 Posts: 46 Location: Chennai
|
|
|
|
Narisimha,
P11.0 indicates it is a packed decimal field with 11 digits before decimal point. If it is P11.2 then 9 before decimal point & 2 digits after decimal point.
Here 'FIELD=SDD_NBR ,SDD_NBR ,P11.0 ,P5 ,MISSING=OFF,$'
Usage is P11.0 & Actual is P5 means it uses only 5 bytes to store the data. I am not sure how this is achieved in Cobol. Missing=off is used to indicates to use null values or not. Default is off indicating null values will not be used.
I think this might work for you.
Please try
05 SDD-NBR PIC S9(6) COMP-3.
I havn't got time to try it so please let me know if it works.
Dinesh |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Many sites have a standard that COMP-3 fields should be defined with an odd number of digits. This is because the sign always uses the least significant half-byte and regardless of the definition, the actual space required in memory or in a file will be whole bytes. |
|
Back to top |
|
|
Narismha
New User
Joined: 22 Nov 2006 Posts: 23 Location: Mumbai
|
|
|
|
Hi Dinesh,
Thanks for your quick response and good information.
For 5 bytes i used 05 SDD-NBR PIC S9(9) COMP-3 and it is working fine.
Thanks
-Narisimha |
|
Back to top |
|
|
|