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
 

 

Converting a comp-3 file to numeric file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ddyuva

New User


Joined: 06 Sep 2012
Posts: 1
Location: india

PostPosted: Thu Sep 06, 2012 6:48 pm    Post subject: Converting a comp-3 file to numeric file
Reply with quote

Hi ,

This is my file which contains the dates in comp-3 format.
CI.M204QAV3.CIFS420.DATA

Here is the copybok of the FIle
*
01 CIFS420-RECORD.
03 C420-TRADING-DATE PIC S9(9) COMP-3.
03 C420-LOGICAL-DATE PIC S9(9) COMP-3.
*

Please let me know on how I can transfer the entire comp-3 file into a file containing numeric data?



Thanks in advance.

Dinesh
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Thu Sep 06, 2012 6:59 pm    Post subject:
Reply with quote

1. A file is not COMP-3, only individual variables can be COMP-3.
2. COMP-3 is numeric -- you need to spend a LOT of time reading the COBOL Language Reference manual (link at the top of this page) to understand this.
3. If you want to convert the COMP-3 fields in your file to DISPLAY fields, you can use your site's SORT product to do this, or you can write a simple COBOL program that copies the file, with the same FD for both files (just change the 01 name), except the output file does not have COMP-3 on the variables. Read a record, move it to the output file FD, write it, repeat until end of file ... not a hard task.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Sep 06, 2012 6:59 pm    Post subject: Reply to: Converting a comp-3 file to numeric file
Reply with quote

Are you talking about an FTP transfer? If so, all COMP-3 (Packed-Decimal) fields need to be converted into Display-Numeric beforehand.

Unless you have negative-dates, the Display-Numeric fields can be unsigned.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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