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
 

 

Data type conversion from FOCUS to COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Data type conversion from FOCUS to COBOL
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    Post subject:
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

Site Director


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

PostPosted: Tue Dec 19, 2006 9:13 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am


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