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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
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    Post subject: Insert fails with Data type Time it gives sql code = -180
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: 1187
Location: Bangalore,India

PostPosted: Thu Mar 15, 2007 3:54 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri Mar 16, 2007 11:10 am    Post subject: Re: Abend code -180
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

Site Director


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

PostPosted: Fri Mar 16, 2007 9:25 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 19, 2007 7:10 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am


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