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
 
How do i change a date format to dd/mm/yyyy

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
vinit

New User


Joined: 31 Jul 2006
Posts: 8
Location: TCS, INDIA

PostPosted: Thu Jan 11, 2007 5:09 pm    Post subject: How do i change a date format to dd/mm/yyyy
Reply with quote

how do i change a date format written in yyyymmdd (length 8) to dd/mm/yyyy(length 10) icon_sad.gif icon_smile.gif
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jan 11, 2007 5:16 pm    Post subject:
Reply with quote

Redefine and moves, reference modification, stringing, what are you looking for, examples?
Back to top
View user's profile Send private message
vinit

New User


Joined: 31 Jul 2006
Posts: 8
Location: TCS, INDIA

PostPosted: Thu Jan 11, 2007 5:56 pm    Post subject: using move statements
Reply with quote

i want to change the date format using the MOVE statement from one format yyyymmdd (length 8) to another format dd/mm/yyyy(length 10)
Back to top
View user's profile Send private message
Aji

New User


Joined: 03 Feb 2006
Posts: 53
Location: Mumbai

PostPosted: Thu Jan 11, 2007 5:58 pm    Post subject:
Reply with quote

Code:
01 date.
02 yy pic 9(4).
02 mm pic 99.
02 dd pic 99.
01 date1.
02 f-dd pic 99.
02 filler pic x value "/".
02 f-mm pic 99.
02 filler pic x value "/".
02 f-yy pic 9(4).

move yy to f-yy.
move mm to f-mm.
move dd to f-dd.
display date1.


Aji Cherian
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jan 11, 2007 6:51 pm    Post subject: Re: using move statements
Reply with quote

vinit wrote:
i want to change the date format using the MOVE statement from one format yyyymmdd (length 8) to another format dd/mm/yyyy(length 10)
OK
Code:
move cymd(7:2) to dmcy(1:2)
move '/'       to dmcy(3:1)
move cymd(5:2) to dmcy(4:2)
move '/'       to dmcy(6:1)
move cymd(1:4) to dmcy(7:4)
That should do it.... icon_smile.gif
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Thu Jan 11, 2007 10:07 pm    Post subject: Re: How do i change a date format to dd/mm/yyyy
Reply with quote

One more way of doing what you want is using the MOVE CORRESPONDING clause of cobol if you are familiar with it.

David.
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Jan 12, 2007 2:57 pm    Post subject: Re: How do i change a date format to dd/mm/yyyy
Reply with quote

Hi,

Quote:
One more way of doing what you want is using the MOVE CORRESPONDING clause of cobol if you are familiar with it.
David.


To add more for what David told, for MOVE CORRESPONDING the subgroup variable names must be same.
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 Compare yesterday's date to the one o... migusd SYNCSORT 9 Fri Sep 22, 2017 11:35 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm

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