Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Help? CVTDAT for cleanup of Spool Files.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help? CVTDAT for cleanup of Spool Files.

    Last year, I wrote a program to display an outq to print, then I copy it to a file, and inside a program, I substring the read of the file to variables. I am using the CVTDAT command and passing *MDY and converting to *JUL. Well, its now January, 09... I have some outq's that I wanted to keep for 30 days, and all my spool files are now gone. What I am doing is taking the current Julian day, less 30 to come up with a new value. Then if the spool file record that I am reading after converting to Jul is greater then my new value, I delete it. Well the program worked great in 2008, and now that its 2009, I have problems. Where did I go wrong? Thanks, Keith

  • #2
    Re:Help? CVTDAT for cleanup of Spool Files.

    Keith, Unfortunately, we can't see your code from this side of the internet, so you'll have to show us the relevant sections in order for us to make any sort of determination. A couple of questions I have: When you say it worked in 2008, do you mean it worked during 2008, or do you mean it worked when 2007 transitioned to 2008? What's the possibility some other entity besides your program deleted the files? Bill

    Comment


    • #3
      Re:Help? CVTDAT for cleanup of Spool Files.

      Hello Bill, I think I found the issue, but not quite sure how to resolve it. I am using *JUL for conversion of MMDDYY for both the current system date, and the spool file create date. I retreive the current day, and convert to *JUL. I read a record from my file that contains a record for each spool file, and convert as well to *JUL. Example... Lets say I have an outq defined QPRINT to maintain those spool files for 30 days. I retreive the system date, convert to *JUL, and subtract 30 from the jullian value. Then in the program I say, if the spool file jullian date is > then the compare value, I delete it. Here's the problem... It works when your system date, and spool files are in the current year. But... On 010509 the *jul value is '09005'. If I subtract 30 from that, I get '08975'... Not good. Now if my current date was 120508 the *jul value is '08340'. If I subtract 30 from that, I get '08310' which works when the spool file value is '08312', it would then get deleted. So the problem is when we changed to a new year. the *JUL logic does not work. I think I need the ability to covert to whats called "lillan" values. I googled and found some discussion on an API, but it does not exist on my V5R3 system. In the example where I say... Not good. What happens is if the system date in say January of 09, and the spool files were created in December 31st, they get deleted and they should not. I hope this make sense. I look forward to your comments or anyone else that can help me use a better method for calculating, it looks like *JUL is not a good choice. Thanks, Keith

      Comment

      Working...
      X