Joined: 09 Mar 2006 Posts: 36 Location: hyderabad,A.P
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.
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.
05 month pic x(2).
05 date pic x(2).
05 year pic x(4).
julian date - YYDDD.
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.