Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Modifying COMP-3 variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Modifying COMP-3 variable
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10457
Location: italy

PostPosted: Sat Dec 04, 2010 1:16 pm    Post subject: Reply to: Modifying COMP-3 variable
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    Post subject: Reply to: Modifying COMP-3 variable
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10457
Location: italy

PostPosted: Sat Dec 04, 2010 3:06 pm    Post subject: Reply to: Modifying COMP-3 variable
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

Active Member


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

PostPosted: Mon Dec 06, 2010 6:32 pm    Post subject:
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    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 COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us