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
 
Exporting decimal field as a COMP-3

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
claudio.esposito

New User


Joined: 16 Mar 2012
Posts: 2
Location: ITALY

PostPosted: Fri Mar 16, 2012 7:51 pm    Post subject: Exporting decimal field as a COMP-3
Reply with quote

Hi all!!

I need to export a sequential file from a table showing decimal fields as COMP 3. Since DB2 v9.7 does not support a statement like EXPORT...OF ASC packeddecimal, does DFSORT supply any facility to do the job?

Thanks a lot.
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Mar 16, 2012 8:08 pm    Post subject:
Reply with quote

claudio.esposito,
Sorry if it sounds like stupid question but are you trying to unload column(s) from db2 table defined as decimal and have it in the file as display fields (numeric edited) so that it can be read in spreadsheet or textpad?

What is the LRECL of the file. What is the column/field position and definition? If possible,provide sample input record and expected output.

Thanks,
Back to top
View user's profile Send private message
claudio.esposito

New User


Joined: 16 Mar 2012
Posts: 2
Location: ITALY

PostPosted: Fri Mar 16, 2012 8:18 pm    Post subject:
Reply with quote

Actually I'm not trying to view in textpad.

Here's the field:
Table:C_QST Field: ID_C_QST Type: DECIMAL
Length:9
There's a copy cobol for that field defined as follow:
03 LRXC3491-ID-C-QST PIC S9(09)V COMP-3

We're emulating the mainframe using Micro Focus.

I need to export the table in a file where that field is written in COMP-3 format.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 16, 2012 10:22 pm    Post subject:
Reply with quote

claudio.esposito,

You can use DFSORT to convert the packed decimal field to readable format with edit masks. PIC S9(09)V COMP-3 is 5 bytes. Assuming that the field is position 1 , here is a way to write it out to display format
Code:

//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC BUILD=(1,5,PD,EDIT=(STTTTTTTTTT),SIGNS=(+,-))     
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm

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