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
 

 

Comp3 Move

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

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Thu Nov 11, 2010 6:53 pm    Post subject: Comp3 Move
Reply with quote

Hi ,

I know this might be asked several times , But I am looking for pointers in this forum for my query.

Here is the requirement.

05 RJ-EFF-DATE PIC S9(7) COMP-3.

This needs to be moved to new field
05 RJ1-EFF-DATE PIC S9(5) COMP-3.

I am moving field1 to Field2 truncation would accur , I need to avoid this.

Please advise for any pointers which are already posted in this forum.


Thanks
Job1919
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Thu Nov 11, 2010 7:31 pm    Post subject:
Reply with quote

If you are moving a 7-byte number to a 5-byte number, and the absolute value of the 7-byte number is more than 99,999 then you cannot avoid truncation. Your code can test for values that would cause truncation and do something about it -- but what you do depends upon the system and needs to be under the direction of your team leader or manager, not us.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 646
Location: Pennsylvania

PostPosted: Thu Nov 11, 2010 8:28 pm    Post subject:
Reply with quote

Would this meet your 'vague' requirement?

IF RJ-EFF-DATE > 99999
MOVE 99999 TO RJ1-EFF-DATE
ELSE
MOVE RJ-EFF-DATE TO RJ1-EFF-DATE
END-IF

If not, what value do you want in the receiving field under those circumstances?

Or, is this a trick question?
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: Thu Nov 11, 2010 10:20 pm    Post subject:
Reply with quote

Hello,

Quote:
Here is the requirement.
Sorry, but this is not a requirement. . .

Let us use something liquid rather than 1's and 0's. . . How would the people who defined this "reauirement" suggest the content of a full 7-gallon container be poured into a 3-gallon container and not spill over.

If this is the type of "requirement" that is common, be very careful what is implemented - no matter how much effort is put into it, it will probably not be what "they" want. . .
Back to top
View user's profile Send private message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Fri Nov 12, 2010 9:48 am    Post subject: Comp3 move
Reply with quote

Hi All,

Thanks for the responses.

Actually this date is current date < MMDDYYYY> which is to be reformatted to MMDDYY and later its converted to Julian dates.

So RJ-Eff-Date gets the current system date or a previous date and then I have to trim it to remove 20 in the year and use only 10.

I was wondering what If i can move this RJ-Eff-Date to Var1 (Pic x(8) ) and then redefine it to Month , date , Year and then move .

Please let me know your suggestions.

Thanks
job1919
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 Nov 12, 2010 9:54 am    Post subject:
Reply with quote

Hello,

Suggest you practice posting the real requirement rather than something that has nothing (that i can see) with what you actually want. . .

Yes, you can move the mmddccyy date to another field and then use only the mm dd yy parts of this new field to creaye a mmddyy date. From there you can do whatever is needed.

The receiving field when you move the comp-3 field should be zoned decimal not "x(8)".
Back to top
View user's profile Send private message
job1919

New User


Joined: 19 Jul 2010
Posts: 21
Location: Chennai

PostPosted: Fri Nov 12, 2010 2:29 pm    Post subject:
Reply with quote

Dick ,

Thanks very much , It worked .. I moved the Comp3 variable to a variable with X(08) and then redefined to move individually..

Thank you daveporcelan , Robert Sample & Dick once again.

job1919
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 Nov 12, 2010 8:25 pm    Post subject: Reply to: Comp3 Move
Reply with quote

Good to hear it is working - thank you for letting us know and posting your solution icon_smile.gif

d
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
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm
No new posts how to move view the remote file in o... mailtoashok CICS 2 Fri Feb 12, 2016 1:07 pm


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