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

Data type conversion from FOCUS to COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Narismha

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Tue Dec 19, 2006 12:40 pm
Reply with quote

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

New User


Joined: 06 Dec 2006
Posts: 46
Location: Chennai

PostPosted: Tue Dec 19, 2006 6:59 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Dec 19, 2006 9:13 pm
Reply with quote

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

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Wed Dec 20, 2006 9:49 am
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top