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: 8152
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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

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