View previous topic :: View next topic
|
Author |
Message |
claudio.esposito
New User
Joined: 16 Mar 2012 Posts: 2 Location: ITALY
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
claudio.esposito
New User
Joined: 16 Mar 2012 Posts: 2 Location: ITALY
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
|