Home > AS/400 Tips > iSeries administrator tips > Auto-creating file names for daily reports
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Auto-creating file names for daily reports


Scott Ingvaldson
08.29.2001
Rating: -3.27- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


If you have reports that run daily (or on any set schedule) you may want to be able to keep a history of past reports for some period of time. If your job overwrites the same file every day you have to manually copy or rename it to keep it around for comparison. This bit of code will allow you to create a filename that ends with the date created (mm/dd) so that you can immediately know which day the report was run, as well as delete older reports in a timely manner. It could easily be modified to use a time stamp rather that the date, or to automatically delete files older than a certain date.



Code

 
RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DAT)                     
CHGVAR     VAR(&MON) VALUE(%SST(&DAT 1 2))                
CHGVAR     VAR(&DAY) VALUE(%SST(&DAT 3 2))                
 
CHGVAR     VAR(&FILE) VALUE('FILE' *TCAT &MON *TCAT &DAY)                                 
		
		Code: DCL        VAR(&DAT) TYPE(*CHAR) LEN(6) 
DCL        VAR(&FILE) TYPE(*CHAR) LEN(10)
DCL        VAR(&MON) TYPE(*CHAR) LEN(2) 
DCL        VAR(&DAY) TYPE(*CHAR) LEN(2) 
 
RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&DAT)                     
CHGVAR     VAR(&MON) VALUE(%SST(&DAT 1 2))                
CHGVAR     VAR(&DAY) VALUE(%SST(&DAT 3 2))                
 
CHGVAR     VAR(&FILE) VALUE('FILE' *TCAT &MON *TCAT &DAY)    

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries administrator tips
How to: Upgrade the OS for AS/400
V6R1 upgrade planning checklist
Connecting multiple iSeries systems through DDM
Analyze the health of your IBM i server with iScore
Researching high availability for your System i shop
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i

Performance
Will overloaded discs impact iSeries performance?
Extend storage capacity on an IBM i without negatively effecting system performance
Database drivers on the i: MySQL vs. IBM Toolbox
Performance tuning for IBM i: The basics and beyond
IBM releases new Power products for the midrange
Top System i admin tips for 2006
Catholic Charities keeps track of homeless with iSeries
i5 error messages: What you need to know
IBM races for clock speed
System shutting down after cleanup

iSeries system performance and monitoring
Analyze the health of your IBM i server with iScore
Translating Linux for IBM i admins: Working with jobs and networking
Database performance comparisons on IBM i
How to: Monitoring job activity on the AS/400
Performance tuning for IBM i: The basics and beyond
How to: Reduce the percentage of ASP used on the AS/400
Detecting system changes made by outside IP address
AS/400 system values quiz
Checking on System i disk space requires creating a new command: XRTVSYSSTS
Drive space management commands

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
CIW  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2010, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts