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: 7254

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: 6966
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: 7932
Location: Bellevue, IA

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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Moving a PD to PD spoorni DFSORT/ICETOOL 8 Fri Oct 07, 2016 9:52 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


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