MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

need to display decimal field in readable form to flat file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Sun Oct 30, 2005 3:51 pm    Post subject: need to display decimal field in readable form to flat file Reply with quote

Hi all,

I am trying to retreive selective columns EMPNO and SALARY data from a DB2 table to a flat file.In my table declarations i have created a table with the following declarations :

Code:

EMPNO   CHAR(7)
SALARY  DECIMAL(9,2)



I already have inserted values into the table successfully

Code:

 EMPNO         SALARY
-------  ------------
111111       16166.70
222222       15666.70
333333       14916.70
444444       14583.40
555555       14583.40


But when i try to retreive data to a flat file from my JCL using UTILITY IKJEFT01 i am not getting properly displayed values of SALARY in readable format as SALARY field equivalent in COBOL is PIC S9(7)V9(2) USAGE COMP-3 which cannot be read in ISPF directly without any tool.

Code:

//UNLOAD1  EXEC PGM=IKJEFT01,REGION=8M                                 
//DBRMLIB  DD DSN=TECH022.TESTING.DVRDBRM,DISP=SHR                 
//DXTPRINT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSABEND DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//DSNTRACE DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//DXTDUMP  DD SYSOUT=*                                                 
//DATAOUT  DD DSN=TECH022.TESTJCL.OUTPUT,                               
//            DISP=(NEW,CATLG,CATLG),                                   
//            VOL=(,,,99),UNIT=SYSDA,                               
//            DCB=(RECFM=FB,LRECL=80),SPACE=(TRK,(10,10),RLSE)         
//SYSTSIN  DD DSN=TECH022.CARDS(IWDRF110),DISP=SHR                         
//DXTIN    DD *                                                         
 SUBMIT EXTID=WABCDE,                                                   
        DBS=DB2,                                                       
        FORMAT=SOURCE,           
        EXTDATA=DATAOUT         
 EXTRACT                         
  SELECT EMPNO,SALARY
  FROM TECH022.EMPLOYEE;     
//                       




[code:1:74b4e23a4c]
TECH022.TESTJCL.OUTPUT
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
111111 ...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12401
Topics: 75
Location: San Jose

PostPosted: Sun Oct 30, 2005 5:17 pm    Post subject: Reply with quote

shekar123,

Code:

 SELECT EMPNO
       ,CHAR(SALARY)
  FROM TECH022.EMPLOYEE
  ;


Check this link for a detailed explanation of the function CHAR

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/3.2.11?SHELF=&DT=20010718164132&CASE=

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Mon Oct 31, 2005 3:33 am    Post subject: need to display decimal field in readable form to flat file Reply with quote

Thanks Kolusu,

I was able to get the desired result after going through the link provided and i was able to understand many concepts related to displaing db2 table data in readable format.



From one of the great fans of Kolusu
Shekar123
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group