View previous topic :: View next topic
|
Author |
Message |
krishnasaikiah
New User
Joined: 14 Mar 2007 Posts: 24 Location: gurgaon
|
|
|
|
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 |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Krishna,
Would you please paste the code of moving value from ACTIVITY-TIME-HH ? |
|
Back to top |
|
|
krishnasaikiah
New User
Joined: 14 Mar 2007 Posts: 24 Location: gurgaon
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
krishnasaikiah
New User
Joined: 14 Mar 2007 Posts: 24 Location: gurgaon
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|