Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Setting Font Type for XMIT satish.ms10 All Other Mainframe Topics 3 Fri Sep 15, 2017 10:01 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Extract Data till prev hour balaji81_k DB2 16 Fri Aug 25, 2017 9:25 pm
No new posts FTP data transfer from PC to Mainfram... AJAYREDDY All Other Mainframe Topics 8 Wed Aug 23, 2017 9:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us