View previous topic :: View next topic
|
Author |
Message |
Naresh Dasari
New User
Joined: 16 Oct 2007 Posts: 9 Location: Chennai
|
|
|
|
Hi,
Can anyone help me in modifying a COMP-3 variable and moving into another COMP-3 variable in cobol program.
I have a variable like WS00-DATE PIC S9(07) COMP-3 which contains current system date in julian format (eg: +2010350). Now i need to modify this in the format +3502010 and move to WS00-DATE-KEEP PIC S9(07) COMP-3. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
that' s simple math You are asking for
if You divide yyyyddd by 1000
the quotient is the year part yyyy
the remainder is the days part ddd
at this poin dddyyyy = ddd*10000 + yyyy |
|
Back to top |
|
|
Naresh Dasari
New User
Joined: 16 Oct 2007 Posts: 9 Location: Chennai
|
|
|
|
Thanks enrico. i really didnt think in that way :-). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
well... everybody is allowed a brain check once in a while |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Try to eliminate irrelevant details from your questions in order to clarify your own understanding of the problem.
This is not a COMP-3 issue, but rather an numeric formatting (rearrangement) issue. |
|
Back to top |
|
|
|