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

Exporting decimal field as a COMP-3


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 577
Location: USA

PostPosted: Fri Mar 16, 2012 8:08 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Join 2 files according to one key field. JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
Search our Forums:

Back to Top