View previous topic :: View next topic
|
Author |
Message |
rohit jaiswal Warnings : 2 New User
Joined: 09 Mar 2006 Posts: 36 Location: hyderabad,A.P
|
|
|
|
hi
my requirement is that i have a vsam file in which the date format is in yymmdd format with data type as alphanumeric . i need to convert this to numeric type and also it shud be in the julian date format. if any one has the code please send it or tell me a way to do it.
thanks in advance
regards
rohit. |
|
Back to top |
|
|
purushoth_jp
New User
Joined: 12 Dec 2004 Posts: 22
|
|
|
|
hi rohit,
just i'm giving u the logic for the below requirement.
just read record from VSAM file, move the date filed to a new alpha numeric variable, pass this variable to a sub program which converts this date to a julian date. now move that julian date to a new variable which is of numeric type and return the same to the main program.
logic to convert date to a julian date
regular date format - MM/DD/YYYY.
refular date
01 date.
05 month pic x(2).
05 date pic x(2).
05 year pic x(4).
julian date - YYDDD.
01 jul
05 ye-jul pic 9(2).
05 dat-jul pic 9(3).
have a occurs claue for month field for ex
05 month-filed pic 9(2) occurs 12 times.
store 31 in month filed (1), 28 or 29 in month filed(2) ....
suppose if the date is 21/05/06 is given then
move month to n. ---> we are moving 05 to n
perform para-a varying i from 1 by 1 until i < n.
add date to dat-jul
move year to ye-jul.
display jul.
para-a
add month-field(i) to dat-jul.
let me know if u have any quires |
|
Back to top |
|
|
rohit jaiswal Warnings : 2 New User
Joined: 09 Mar 2006 Posts: 36 Location: hyderabad,A.P
|
|
|
|
hi purushoth
thanks for the concern but i habe completed the conversion by using some routines and applying my own logic.
regards
rohit |
|
Back to top |
|
|
SKAMF
New User
Joined: 05 Jun 2006 Posts: 1
|
|
|
|
hi purushotha, i did not understand why u gave valeus 31, 28,29 to occurs months field..
ok, u move 05 to month
how thatmeans u ar doing the loop until, 05
perform para-a varying i from 1 by 1 until i < n.
add date to dat-jul
move year to ye-jul.
display jul.
para-a
add month-field(i) to dat-jul.
so month-field (i) contains-5
u add the date x(2) to date-jul, and move the year to ye-jul..
Pls clarify.. |
|
Back to top |
|
|
|