as/400 how to display current date in spool file?

40 pts.
Tags:
AS/400 Spool Files
i have some spooled files.i created spoolfiles 10 days back.but i want display spoolfiles in printer with current date.please give me the answer? 

Software/Hardware used:
as 400
ASKED: August 6, 2010  12:55 PM
UPDATED: August 6, 2010  8:39 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

                                                            
 D DATE1           S               D    DATFMT(*DMY)                                          D TIME1           S               T    TIMFMT(*HMS)        
 D TIMESTAMP1      S               Z                        
 C                   EVAL      DATE1 = %DATE()              
 C                   EVAL      TIME1 = %TIME()              
 C                   EVAL      TIMESTAMP1 = %TIMESTAMP()    
 C     ‘DATE IS : ‘  DSPLY                   DATE1          
 C     ‘TIME IS : ‘   DSPLY                   TIME1          
 C     ‘TIMESTAMP : ‘DSPLY                   TIMESTAMP1     
 C                   EVAL      *INLR=*ON                   

———————————————
Note that the above does not put current date into a spooled file. Instead, it creates variables that contain a ‘current date’ value. The above code would also need to locate the desired spooled files, materialize them into user spaces (or other containers), locate the appropriate spots in the spaces, overlay the memory locations with the new values, then generate replacement spooled files from the spaces.
Tom

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    I'm not aware of any system that provides a way to change data in a spooled printer file. AS/400s, however, do provide fairly easy methods of generating new versions of spooled files with modified content as Rudedog noted in the answer. And I agree with the part of the answer that questions the ethics of making such a change. If a new date is needed, the process should be run again. If the process cannot be run again, then any such printed report is false and potentially fraudulent. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following