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 

Unload putting low value at end of data set

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


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Wed Jul 30, 2014 3:42 pm    Post subject: Unload putting low value at end of data set Reply with quote

running an unload with this sql:
SELECT CHAR(SUM(POR1_GROSS_PRM_AMT))
the row looks like this with hex turned on, there is a dot at the end
Code:

 0033534144268.65.
4FFFFFFFFFFFFF4FF0
00033534144268B650

do u know how to remove this dot? i tried substring 1,17 around the code and it still did it
this data set it going to be ftp'd to pc then emailed to customer to open in their tool of choice
Back to top
View user's profile Send private message
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Wed Jul 30, 2014 3:46 pm    Post subject: Reply with quote

p.s.
this is comp-3 field I am selecting
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 30, 2014 4:05 pm    Post subject: Reply with quote

newcobol,

What is the column definition of POR1_GROSS_PRM_AMT? DECIMAL(15,2) ? Does it allow NULLS?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
newcobol
Beginner


Joined: 20 Apr 2006
Posts: 88
Topics: 22

PostPosted: Wed Jul 30, 2014 4:31 pm    Post subject: Reply with quote

DECIMAL , 11 , 2 ,N

decimal 11(meaning total) with 2 after the decimal point no nulls
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jul 30, 2014 5:26 pm    Post subject: Reply with quote

newcobol,

One good thing about Unload is that it writes out the positions of the data and if you looked at SYSPUNCH dataset you would have found this

Code:

LOAD DATA LOG NO INDDN SYSREC00 INTO TABLE                           
    TBLNAME                                                           
 (                                                                   
 " "                                    POSITION(       1         )   
 CHAR(                     17)                                       
      NULLIF(      18)=X'00'                                           
 )                                                                   


So we need to handle the NULL condition and you can use IFNULL/VALUE/COALESCE
Code:

CHAR(IFNULL(SUM(POR1_GROSS_PRM_AMT),0)) 


The SYSPUNCH will now have the following

Code:

LOAD DATA LOG NO INDDN SYSREC00 INTO TABLE                         
    TBLNAME                                                         
 (                                                                 
 " "                                    POSITION(       1         )
 CHAR(                     17)                                     
 )                                                                 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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