View previous topic :: View next topic
|
Author |
Message |
vinit
New User
Joined: 31 Jul 2006 Posts: 8 Location: TCS, INDIA
|
|
|
|
how do i change a date format written in yyyymmdd (length 8) to dd/mm/yyyy(length 10) |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Redefine and moves, reference modification, stringing, what are you looking for, examples? |
|
Back to top |
|
|
vinit
New User
Joined: 31 Jul 2006 Posts: 8 Location: TCS, INDIA
|
|
|
|
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 |
|
|
Aji
New User
Joined: 03 Feb 2006 Posts: 53 Location: Mumbai
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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.... |
|
Back to top |
|
|
David P
Active User
Joined: 11 Apr 2005 Posts: 106 Location: Cincinnati Ohio
|
|
|
|
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 |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
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 |
|
|
|