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

Insert fails with Data type Time it gives sql code = -180


IBM Mainframe Forums -> ABENDS & Debugging
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishnasaikiah

New User


Joined: 14 Mar 2007
Posts: 24
Location: gurgaon

PostPosted: Thu Mar 15, 2007 3:46 pm
Reply with quote

I X(02).

I have moved elementary items ACTIVITY-TIME-HH AND ACTIVITY-TIME-MM to elementary items of working storage variable declared below W01W-ACTIVITY-TIME.
Elementary items are moved correctly but when we display group item W01W-ACTIVITY-TIME, it displays 17N00N00 instead of 17.00.00 i.e N instead of . even when we have used a filler with value ?.?In W01W-ACTIVITY-TIME.
Now because it is taking N instead of ., when we r trying to insert this value in table for a column with data type Time , insert fails and it gives sql code = - 180

Working storage section.

05 W01W-ACTIVITY-TIME.

10 W01W-ACTIVITY-TIME-HH PIC X(02).

10 FILLER PIC X(01) VALUE '.'.

10 W01W-ACTIVITY-TIME-MM PIC X(02).

10 FILLER PIC X(01) VALUE '.'.

10 W01W-ACTIVITY-TIME-SS PIC X (02).
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 3:54 pm
Reply with quote

Hi Krishna,

Would you please paste the code of moving value from ACTIVITY-TIME-HH ?
Back to top
View user's profile Send private message
krishnasaikiah

New User


Joined: 14 Mar 2007
Posts: 24
Location: gurgaon

PostPosted: Fri Mar 16, 2007 8:40 am
Reply with quote

Code:
IF W05W-ACTIVITY-TIME-HH IS NUMERIC                       
   IF W05W-ACTIVITY-TIME-HH >= '00' AND                   
      W05W-ACTIVITY-TIME-HH < '24'                         
      MOVE W05W-ACTIVITY-TIME-HH TO W01W-ACTIVITY-TIME-HH 
   ELSE                                   
       MOVE '00' TO W01W-ACTIVITY-TIME-HH   
    END-IF                                 
 ELSE                                       
       MOVE '00' TO   W01W-ACTIVITY-TIME-HH
 END-IF.


The w05w variables are from the input files and w01w are working storage variables.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Mar 16, 2007 11:10 am
Reply with quote

krishnasaikiah wrote:
Elementary items are moved correctly but when we display group item W01W-ACTIVITY-TIME, it displays 17N00N00 instead of 17.00.00 i.e N instead of . even when we have used a filler with value ?.?In W01W-ACTIVITY-TIME.
I find that very hard to believe.....Trust me, you are overlooking something.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 16, 2007 9:25 pm
Reply with quote

Hello,

Please post more of your code. Both the working-storage and the procedure. The code before what you posted in both cases. Also, please post your code using the "Code" tab at the top of the repoly panel.

We cannot offer suggestions until we see what you have and determine why it does not work.
Back to top
View user's profile Send private message
krishnasaikiah

New User


Joined: 14 Mar 2007
Posts: 24
Location: gurgaon

PostPosted: Mon Mar 19, 2007 8:35 am
Reply with quote

Procedure Code

Code:
IF W05W-ACTIVITY-TIME-HH IS NUMERIC                       
   IF W05W-ACTIVITY-TIME-HH >= '00' AND                   
      W05W-ACTIVITY-TIME-HH < '24'                       
      MOVE W05W-ACTIVITY-TIME-HH TO W01W-ACTIVITY-TIME-HH
   ELSE                                   
    MOVE '00' TO W01W-ACTIVITY-TIME-HH 
 END-IF
   ELSE                                       
      MOVE '00' TO   W01W-ACTIVITY-TIME-HH 
END-IF.   

IF W05W-ACTIVITY-TIME-MM IS NUMERIC                       
   IF W05W-ACTIVITY-TIME-MM >= '00' AND                   
      W05W-ACTIVITY-TIME-MM <= '59'                       
      MOVE W05W-ACTIVITY-TIME-MM TO W01W-ACTIVITY-TIME-MM
   ELSE                                                   
      MOVE '00'                  TO W01W-ACTIVITY-TIME-MM
   END-IF                                                 
ELSE                                                     
   MOVE '00'                   TO W01W-ACTIVITY-TIME-MM

MOVE '00'                      TO W01W-ACTIVITY-TIME-SS.

INSPECT W01W-ACTIVITY-TIME     REPLACING ALL SPACES BY ZEROS.

MOVE W01W-ACTIVITY-TIME        TO ACTIVITY-TM        OF
                                  DCLTSVLCATB.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 19, 2007 7:10 pm
Reply with quote

Hello,

Please re-read the earlier request. . .
Quote:
Please post more of your code. Both the working-storage and the procedure. The code before what you posted in both cases. Also, please post your code using the "Code" tab at the top of the repoly panel.


The code that is important is prior to what is posted. Also, the working storage area before the field(s) that do not have the desired result.

Also, please use the "Code" tab. You may click "Preview" to make sure the post is most readable.
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 -> ABENDS & Debugging

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top