DSTDTA now handles SQL STRINGS for selecting data

Submitted by NickLitten on Tue, 10/26/2010 - 08:52

send data from as400 to any pc using email as a spreadsheet for freeEver wanted to extract some data out of an IBMi/AS400 file using SQL and then email that data to someone as an Excel Spreadsheet?

Now you can… all from one IBMi command without having to write any CL code to do it.

I added this new function to the PROJEX400 - Distribute Data command last night – so it can now take a bite of selected data using SQL and send it as a TXT, CSV, XML or PDF as EMAIL.

Huge timesaver for me and has been on my wish-list for ages.

Example:

DSTDTA FILE(CSP20) DATA(*SQL) DATASQL('select * from CSP20 where CONO20 = ''??'' and PSTD20 between 1061001 and 1101022') METHOD(*EMAIL) TYPE(*XML) EMAIL(*prompt) INSERT(*LINK) SUBJECT('Here is the spreadsheet for data range 10/01/2010 thru 10/22/2010') IFSDIR(*USER) IFSDOC('CSP20 Spreadsheet') STAMP(*YES)                                                                                                    

Creates a spreadsheet in the IFS called /home/nlitten/csp20spreadsheet[10-26-2010_08.34.06].csv and emailed a link to me.

It's a thing of beauty. Hope it helps somebody.


Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Some Bloke

Projex dot com is the cyber home of Nick Litten an AS400 IBMi developer, RPG programmer, SOA code enthusiast, website tinkerer, information technology evangelist, early adopter, proponent of open source and hopeless technology addict...

Nick Litten looking dazed while refactoring some RPG2 code to kick it into this century

Born and raised in Rainy England, now enjoying programming in the sunshine of Southern USA. Founder of SOFTWARE PROJEX.

Clustermap

Locations of visitors to this page

glqxz9283 sfy39587stf02 mnesdcuix8
sfy39587stf03
sfy39587stf04