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

Modifying COMP-3 variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Naresh Dasari

New User


Joined: 16 Oct 2007
Posts: 9
Location: Chennai

PostPosted: Sat Dec 04, 2010 1:08 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Dec 04, 2010 1:16 pm
Reply with quote

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
View user's profile Send private message
Naresh Dasari

New User


Joined: 16 Oct 2007
Posts: 9
Location: Chennai

PostPosted: Sat Dec 04, 2010 3:02 pm
Reply with quote

Thanks enrico. i really didnt think in that way :-).
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Dec 04, 2010 3:06 pm
Reply with quote

well... everybody is allowed a brain check once in a while icon_biggrin.gif
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Mon Dec 06, 2010 6:32 pm
Reply with quote

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
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
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 Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top