Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us