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
 
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: 8195
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: 2504
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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

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