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
 

 

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: 10256
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: 10256
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: 962
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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