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

Move from Comp3 variable to Edited Variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Aug 10, 2017 4:20 pm
Reply with quote

Hi,

In Cobol pgm we are moving the data from DB2 table (using Embedded SQL) to Edited Variable. Below is the variable definition

Source S9(15)V9(2) Comp-3 - Value 5858.00
Target -9(15).9(2)

But Target display as 58.58.

Please could you let me know where it went wrong?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 10, 2017 4:30 pm
Reply with quote

You didn't read the manual. This is a question an expert would never ask!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 10, 2017 4:50 pm
Reply with quote

A PIC S9(15)V9(2) COMP-3 will NEVER, unless you do something with REDEFINES, have a value of 5858.00 as you posted. It may have a value of 5858 or 585800 (leading zeros ignored) but it will not have 5858.00 since the decimal point is only implied in the PICTURE and will not be part of the value. So either you are editing what the computer tells you or you are lying to us.

Post a DISPLAY of the COMP-3 variable (using the Code tag) so we can see which it is.

And this is definitely not an expert's questions -- perhaps you should be posting in Beginners and Students Forum instead?
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Aug 10, 2017 4:51 pm
Reply with quote

Hi,

Not to offend anyone - I thought this was a forum I could get an immediate reply as I always got in past. Anyways never mind.
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Aug 10, 2017 4:53 pm
Reply with quote

Thanks a lot for the reply, Robert Sample.
please note - the above comment was not meant to you.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 10, 2017 5:21 pm
Reply with quote

sreekusr wrote:
Not to offend anyone - I thought this was a forum I could get an immediate reply as I always got in past.

Which is as about as offensive as you can get...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Aug 10, 2017 5:43 pm
Reply with quote

what could You expect from somebody who claims as
Quote:
Mainframe skills : Making friends,Music anf going out


icon_cool.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 10, 2017 5:54 pm
Reply with quote

A forum like this is not a place to expect immediate replies. Responding is voluntary on this, and most, fora -- meaning people respond when they have the time, and the knowledge of the topic; it is entirely normal for hours to days to pass before a response.
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Aug 10, 2017 5:59 pm
Reply with quote

Thanks all for the response!! I think I am having a bad at office ..Sorry for the trouble caused.... I think I should have been more mature in asking questions, in fact I should gone through my basics before putting here, my bad. Apologies.

Regarding the Issue - it seems the coder has did some mistake of editing it before passing to target which screwed things up..
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top