Home > AS/400 Tips > iSeries programmer tips > System i document management tips
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

System i document management tips


Keith Green, Pattie N. Clayton, Kevin C. Ketzler; Contributors
02.05.2008
Rating: -4.60- (out of 5)


iSeries news and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


In response to a recent tip from the System i community about the XCPYSPLF command's potential for e-mail delivery, iSeries programmers and IT staff flooded the Search400.com mailboxes with follow-up questions, code modifications and more System i tips.

Below are a sample of the iSeries document management tips we received. More will follow. You can always submit a tip using the site's form or e-mail the editor directly if you have comments or feedback. Thanks to everyone who sent their document management how-to's and suggestions.


Access Word docs from Help in RPGILE
At NPE I like the ability to do documentation in Word and be able to access it directly from a Help request in an RPGILE program.

All you need is a shared folder under the Home directory. I called the folder DOCUMENTATION. I create my documentation in Word and save it to this folder. For printing reasons we use Adobe to make it into a PDF file. By calling this small CL program you have the documentation being displayed in Adobe and when you exit it returns you to the iSeries screen. (Where ever you have your help key response within the RPGILE program you place the call to something similar to this CL program. If the file being accessed is .doc then it will show in Word. If the extension is .csv then it will show in Excel.

I have placed all 9's for our port address to the iSeries, and we use the port address to avoid domain name conflicts. I use the name of the RPGILE program with the PDF extension to keep my documentation matched and easy to track.

1.00        PGM                                                                     080109 
2.00        STRPCO                                                                  080109 
3.00        MONMSG MSGID(IWS4010)                                                   080109 
5.00        STRPCCMD PCCMD('//99.9.9.99/HOME\DOCUMENTATION\DH1000.PDF')             080131 
6.00        ENDPGM                                                                  080109

Keith Green
NPE, Inc.
I-Series Systems Analyst


Copy queued docs to your AS/400
When we have a need to e-mail documents, I set up a special out queue that is not attached to a printer. If anything is moved to this out queue, it will be automatically copied to a folder on the AS/400 so the users can access it. The code below is the job that checks the out queue and copies documents to the folder. I can see where using the XCPYSPLF might be better or can be used in combination with this methods.

PGM                                                   
DCL        VAR(&DATETIME) TYPE(*CHAR) LEN(20)         
DCL        VAR(&FILENAME) TYPE(*CHAR) LEN(20)         
DCL        VAR(&COUNT) TYPE(*CHAR) LEN(6)             
DCL        VAR(&NCOUNT) TYPE(*DEC) LEN(6)             
DCL        VAR(&HHMM) TYPE(*CHAR) LEN(6)              
DCL        VAR(&DAYWEEK) TYPE(*CHAR) LEN(4)           
DCL        VAR(&HH) TYPE(*CHAR) LEN(2)                
DCL        VAR(&MM) TYPE(*CHAR) LEN(2)                
DCL        VAR(&NMM) TYPE(*DEC) LEN(2 0)              
DCL        VAR(&NHH) TYPE(*DEC) LEN(2 0)              
DCL        VAR(&ADD) TYPE(*CHAR) LEN(4)               
DCL        VAR(&SSNUM) TYPE(*DEC) LEN(4 0)            
                                                      
DCLF       FILE(OUTFILE)                              
/*FIRST DETERMINE IF THERE ARE ANY REPORTS IN THE OUTQ */               
             WRKOUTQ    OUTQ(EMAIL) OUTPUT(*PRINT)                      
             CPYSPLF    FILE(QPRTSPLQ) TOFILE(OUTQFILE)                 
             RUNQRY     QRY(OUTQFILE)                                   
             DLTSPLF    FILE(QPRTSPLQ)                                  
                                                                        
/*READ THE FILE CREATED BY OUTQFILE QUERY */                            
 LOOP:       RCVF                                                       
             MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(END))           
/*COPY THE SPOOLFILE TO A FILE THAT CAN BE COPIED TO A PC FOLDER */     
             CHGVAR     VAR(&SSNUM) VALUE(&SNUM)                        
             CPYSPLF    FILE(&NAME) TOFILE(SPOOLFILE) +                 
                          JOB(&NUM/&USER/&JOB) SPLNBR(&SSNUM)           
                                                                        
/*CREATE THE FILE NAME USING A COUNTER SO THAT IT WILL BE UNIQUE     */
             RTVDTAARA  DTAARA(EMAILCNT (1 6)) RTNVAR(&COUNT)           
             CHGVAR VAR(&NCOUNT) VALUE(&COUNT)                          
                                                                        
             IF         COND(&NCOUNT *GT 999990) THEN(CHGVAR +          
                          VAR(&NCOUNT) VALUE(0))                        
                                                                        
             CHGVAR VAR(&NCOUNT) VALUE(&NCOUNT + 1)                     
             CHGVAR VAR(&COUNT) VALUE(&NCOUNT)                          
             CHGDTAARA  DTAARA(EMAILCNT) VALUE(&COUNT)                  
             CHGVAR     VAR(&FILENAME) VALUE('RP' *CAT &COUNT *CAT +    
                          '.DOC')                                       
             CPYTOPCD   FROMFILE(SPOOLFILE) TOFLR(EMAILRPT) +           
                          TODOC(&FILENAME) REPLACE(*YES)                
                                                                        
/*DELETE THE SPOOL FILE GENEREATED */                                   
             DLTSPLF    FILE(&NAME) JOB(&NUM/&USER/&JOB) SPLNBR(&SSNUM) 
                                                                        
...+... 1 ...+... 2 ...+... 3 ...+.
            GOTO LOOP               
                                    
                                    
 END:                               
                                    
                                    
STOP:                               
             ENDPGM    

Pattie N. Clayton
Information Technology
City of Danville


A handy comment line eases prototype woes
When creating a procedure prototype and interface for the main program to replace the *ENTRY PLIST, I add a comment line that includes the word "*ENTRY" so that someone searching can find it more easily.

*******************************************************************************************
 * *ENTRY Prototypes                                                                           
 *******************************************************************************************
d otr069          pr                                                                           
d  pOrder                        7a                                                            
d  pLine                         4a                                                            
d otr069          pi                                                                           
d  pOrder                        7a                                                            
d  pLine                         4a                                                            

Kevin C. Ketzler
Affiliated

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.




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


RELATED CONTENT
iSeries managed email and groupware
IBM releases DB2 email archiving hardware and software
Basic security considerations for a Domino/WebSphere system
Email to pager over iSeries
Using the SNDDST command to e-mail extraction data
Options for accepting or declining rescheduled meetings
Lotus updates Workplace apps and Notes roadmap
Partners shoulder hopes for Domino's future
IBM unveils new software model with Workplace 2.0
IBM delivers middleware for utilities, government markets
What's Domino's destiny?
iSeries managed email and groupware Research

Printing on iSeries
Changing the default system printer for AS400
Printing IPDS with overlays to Xerox MFU printers
How to combine multiple spooled files into a PDF
Remote *LAN printer configuration: Not printing full documents
How to view AFP print spools remotely
Learning Guide: Printing from the iSeries
Word Search: iSeries printing
Fast guide to Redbooks and guides on printing/output
20 printing tips in 20 minutes
Printing AFP output
Printing on iSeries Research

iSeries programmer tips
Date calculation commands for AS/400
There is very little RPG on System i can't do: From RPG nay to RPG yay!
Using SQL on System i to color source code and inline comments
Controlling spool files with APIs
Selective SPOOLFILE copy to CSV files and e-mail
System i Resume Building 101
Web skills crucial to iSeries programmer professional development
System i no longer the stepchild of IBM's world
System i Web app dev for free
New i5/OS features announced as anticipation mounts

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
Advanced Function Printing  (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.

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

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




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