Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

YYDDD to YYYYDDD 1

Status
Not open for further replies.

claudeb

Programmer
Nov 23, 2000
140
CA
HI,
How can i change a julian date YYDDD to a YYYYDDD form?
instead of 99320 have a 1999320.
thanks
claudeb
 
something like this:

01 YYDDD.
03 YYDDD-YY PIC XX.
03 YYDDD-DDD PIC XXX.

01 YYYYDDD.
03 YYYYDDD-CC PIC XX.
03 YYYYDDD-YYDDD.
05 YYYYDDD-YY PIC XX.
05 YYYYDDD-DDD PIC XXX.

MOVE YYDDD TO YYYYDDD-YYDDD.
IF YYDDD-YY < 50
MOVE '20' TO YYYYDDD-CC
ELSE
MOVE '19' TO YYYYDDD-CC.

I hope this is helpful.

 
thanks, i'll try that with a pic 9.
claudeb
 
This will also work with minor modifications for standard dates in a yymmdd format, but when selecting your pivot year (50 was the pivot year in Crox's example), be sure to select one that goes with the type of dates you are using. The 50 works great for recent dates, but you should be very careful in your criteria if the dates are birthdates. Perhaps, if they are birthdates, you know something extra about the people in the data file, eg. elementary school students would likely be 5-12, licensed drivers are probably 16-99, etc. It's an inexact science at best, but carefully selecting the pivot point depending on your population can get you results that are usually accurate. Betty Scherber
Brainbench MVP for COBOL II
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top