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

Converting a comp-3 file to numeric file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Sep 06, 2012 6:59 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Sep 06, 2012 6:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top