Generation of multiple xls files

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
2 posts Page 1 of 1

anieder

Posts: 1
Joined: Fri Apr 05, 2013 4:39 am

Post by anieder » Mon Apr 08, 2013 1:19 am
Hello there,

we are running GA/400 4.2 on iseries 7.1

I am trying to create a number of xls files out of one AS/400 database file. Background is to send a list of item numbers to all active suppliers. The base file has the supplier number and item number (and more) fields and looks like this:

suppl1 item1
suppl1 item2
suppl2 item1
suppl3 item1
suppl3 item2....

What i want to do is to create one xls file for each supplier i find in this file (= report break).

Can this be done with standard GA/400 functionality?

Any hint is very much appreciated.

Axel Niederquell

Support_Rick

Support Specialist
Posts: 592
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Apr 08, 2013 10:31 am
Axel,

You can perform this functionality easily using the SQL Task to retrieve a unique list of Supplier codes, then loop through that Rowset and calling the SQL Task again (inside the loop) to retrieve the items into a separate Rowset then writing that 2nd Rowset to a CSV. In Pseudo Terms:
Code: Select all
<sql Task>
<Query = "Select Distinct Supplier_Code from MyTable" OutputRowsetVariable="MySuppliers">

<ForEach InputRowsetVariable="${MySuppliers}" ItemVar="ThisSupplier">

   <sql Task>
   <Query = "Select Item, ItemDesc, ItemCost from MyTable where Supplier=${ThisSupplier[1]}" OutputRowsetVariable="SupplierItems">

   <writeCSV InputRowsetVariable="${SupplierItems}"
</Foreach>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
2 posts Page 1 of 1