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: 10210
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: 10210
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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am


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