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
 

 

Moving group varibale to COMP3 variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
lakshmankumar
Currently Banned

New User


Joined: 02 Jun 2010
Posts: 6
Location: Mysore

PostPosted: Thu Jul 14, 2011 4:28 pm    Post subject: Moving group varibale to COMP3 variable
Reply with quote

01 PARM-PRCSS-YYMMDD.
10 PARM-PRCSS-YY PIC 9(02) VALUE 12.
10 PARM-PRCSS-MM PIC 9(02) VALUE 34.
10 PARM-PRCSS-DD PIC 9(02) VALUE 56.

01 PRCSS-DATE PIC S9(09) COMP-3 VALUE ZEROS

Move PARM-PRCSS-YYMMDD TO PRCSS-DATE .

OUTPUT : PRCSS-DATE 12345
-----------------------------------------
PARM-PRCSS-YYMMDD : 123456 but I after move comp-3 having 12345
but i am exepecting same value 123456

truncation is happaning why ?
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jul 14, 2011 4:36 pm    Post subject:
Reply with quote

What the heck were you expecting? Tell us, exactly, in the five-byte packed-decimal field, what were you expecting when you moved a six byte group item to it?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jul 14, 2011 4:41 pm    Post subject:
Reply with quote

that is the problem with the new compliers.

instead of forcing people to use NUMVAL/IF NUMERIC etc..
it allows idiot code to compile and then expects the same coders to have read the documentation and understand what happens.

it is like teaching someone to drive and providing only one instruction:
here is the gas pedal.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8118
Location: East Dubuque, Illinois, USA

PostPosted: Thu Jul 14, 2011 5:05 pm    Post subject:
Reply with quote

lakshmankumar: your problems are many here:

1. There is a link at the top of the page to Manuals. Click on it, find the COBOL Language Reference manual, and read it until you understand the internal format for DISPLAY, group, COMP-3 variables.
2. You have invalid values for month and day in your grouip variable -- never a good idea.
3. If you read section 6.2.24.3 of the COBOL Language Reference manual, you will find that using a group for your MOVE source means no data conversion will happen. This is important because COMP-3 and DISPLAY do not have the same internal format.
4. If you do not understand why PRCSS-DATE is a 5-byte variable, you need to go back to the COBOL Language Reference manual for more reading.

Finally, based upon your issue and your complete and total lack of understanding of COBOL, I highly recommend you leave this forum and join the Beginners and Students Forum instead. This forum is for professional programmers and you are a long way from being a professional programmer.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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