Home > AS/400 Tips > iSeries programmer tips > Selective SPOOLFILE copy to CSV files and e-mail
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES PROGRAMMER TIPS

Selective SPOOLFILE copy to CSV files and e-mail


Benito Abraham, Contributor
01.28.2008
Rating: -4.49- (out of 5)


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


The XCPYSPLF command lets iSeries programmers send reports in CSV file format to e-mail accounts. In order to properly explain how it works we are going to develop an example. I've included the source code for this command at the bottom of the page.

Let's say that we want to work with the AMARTINEZ'S $SYSLIST file:
[IMAGE]

We go to the selected record and type 5 > Enter.
[IMAGE]

Since we only want the records and not the headlines, we must create a selection criteria. Generally speaking, we have to choose a character that is repeated in the same position in the records we want to include in our file. Iit could be a decimal point, a dash, etc. In this example we'll choose a '/' located in position 19.

We go back to our spool (enter) and hit F11 twice:
[IMAGE]

Next, write down the marked values for the selected spool: File: $SYSLIST
Spool Number: 4
Job: QPADEV0003
User: AMARTINEZ
Job Number: <


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


RELATED CONTENT
Imaging on iSeries
Controlling spool files with APIs
Word Search: iSeries printing
Fast guide to Redbooks and guides on printing/output
20 printing tips in 20 minutes
Use Excel, WebSphere to present live iSeries business data
Document Imaging
Fast guide to Redbooks and guides on printing/output
Quadrant Software's Formtastic Fusion5 delivers full PDF support, seamless document imaging software integration
Ten tips for printing from the iSeries
Premium printing advice
Imaging on iSeries Research

iSeries programmer tips
Groovy programming on IBM i
EGL Rich UI on IBM i: Do you Dojo?
Running PHP open source applications: NOBODY needs authority
Programming for the Web on the IBM i, what is possible
Using geocoding on AS/400 to enhance your Web presence
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
Documenting nested program structures on the AS/400
What is an integrated database?
An automated CL method of moving a query from AS/400 to Excel

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


code>193490

Finally, we invoke the XCPYSPLF command and load the parameters along with the e-mail target:
[IMAGE]

The receiver will see something like this:
[IMAGE]

And the received file will look like this without headlines and in CSV format:
[IMAGE]In order to work properly you should create the folder download with public authority *all and the users must be created in the distribution directory. If for some reason you can't or don't want to send a e-mail, you can find your converted report without headings in the DOWNLOAD folder were you can get it with iSeries Navigator or any other tool that you like.

Below is the source code you'll need:

Source Code XCPYSPLF Cmd

Source Code XCPYSPLF CLP (XCPYSPLF Cpp program)

Back to top

ABOUT THE AUTHOR: Benito Abraham is an analyst programmer at Pride International. He has over 15 years experience on AS/400, including iSeries security and RPG.

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.




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 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts