Query step returning zero rows...

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

rarogerson

Posts: 10
Joined: Fri Aug 30, 2013 4:03 pm

Post by rarogerson » Mon Dec 08, 2014 1:11 pm
Hello,

I have the following project defined.
Code: Select all
<project name="Send_SBT_Sales" mainModule="Main" version="1.0" onError="continue">
	<description>Send the previous day&apos;s sales to an SBT Vendor</description>
	<module name="Main" disabled="false">
               <sql label="Connect to Database" resourceId="Comanche" autoCommit="true" version="1.0">
			<query label="Retrieve the sales" outputVariable="data">
				<statement>SELECT sbdate, sbstore, sbvendor, sbupc, sbqtysold, 
                                                                sbprcqty, sbretail, sbuncost, sbpromo, sbpo#
                                                      FROM tysbt2.sb0010p 
                                                   WHERE sbvendor = ${sbtVendor} 
                                                        and sbdate = ${salesdate}
                                                        and sbstore BETWEEN ${fromstore} and ${tostore}</statement>
			 </query>
		 </sql>
	         <writeCSV label="Create csv file" inputRowSetVariable="${data}"
                                  outputFile="/linoma/goanywhere/userdata/documents/SBT/${ftpFile}"
                                  whenFileExists="overwrite" fieldDelimiter="comma" includeHeadings="true" version="1.0"           
                  />
	</module>

	<variable name="ftpFile" value="SBT-PC-9470-20140824.csv" />
	<variable name="sbtVendor" value="9470" />
	<variable name="salesdate" value="20141003" />
	<variable name="fromstore" value="001" />
	<variable name="tostore" value="999" />
</project>
When I call the project from my RPGLE program the following is displayed in the job log.

12/8/14 9:33:45 AM INFO Start Date and Time: 12/8/14 9:33:45 AM
12/8/14 9:33:45 AM INFO Job Number: 1417969844087
12/8/14 9:33:45 AM INFO Project Name: /POS/Send_SBT_Sales
12/8/14 9:33:45 AM INFO Submitted By: ADMINISTRATOR
12/8/14 9:33:45 AM INFO GoAnywhere Director 4.2.0 running on OS/400 V7R1M0 (PowerPC)
12/8/14 9:33:45 AM INFO Overriding variable 'sbtVendor' with value '9470'
12/8/14 9:33:45 AM INFO Overriding variable 'ftpFile' with value 'SBT-PC-9470-20141123.csv'
12/8/14 9:33:45 AM INFO Overriding variable 'tostore' with value '999'
12/8/14 9:33:45 AM INFO Overriding variable 'fromstore' with value '001'
12/8/14 9:33:45 AM INFO Overriding variable 'salesDate' with value '20141123'
12/8/14 9:33:45 AM INFO Executing project 'Send_SBT_Sales'
12/8/14 9:33:45 AM INFO Project location: /linoma/goanywhere/userdata/projects/POS/Send_SBT_Sales.xml
12/8/14 9:33:45 AM INFO Executing module 'Main'
12/8/14 9:33:45 AM INFO Executing task 'sql 1.0 (Connect to Database)'
12/8/14 9:33:45 AM INFO Executing sub-task 'query'
12/8/14 9:33:45 AM INFO Query completed successfully and the rowset 'data' was created
12/8/14 9:33:45 AM INFO Finished sub-task 'query'
12/8/14 9:33:45 AM INFO Finished task 'sql 1.0 (Connect to Database)'
12/8/14 9:33:45 AM INFO Executing task 'writeCSV 1.0 (Create csv file)'
12/8/14 9:33:45 AM INFO 0 record(s) were written from rowset '${data}' to '/linoma/goanywhere/userdata/documents/SBT/SBT-PC-9470-20141123.csv' (82 bytes)
12/8/14 9:33:45 AM INFO Finished task 'writeCSV 1.0 (Create csv file)'
12/8/14 9:33:45 AM INFO Finished module 'Main'
12/8/14 9:33:45 AM INFO Finished project 'Send_SBT_Sales'
12/8/14 9:33:45 AM INFO End Date and Time: 12/8/14 9:33:45 AM

I have run the query
SELECT sbdate, sbstore, sbvendor, sbupc, sbqtysold,
sbprcqty, sbretail, sbuncost, sbpromo, sbpo#
FROM tysbt2.sb0010p
WHERE sbvendor = 9470
and sbdate = 20141123
and sbstore BETWEEN 1 and 999;

in iNav and subsistuted in the variables that the joblog shows and rows ARE returned.

So why is the joblog showing zero rows written?
I have confirmed the CSV is being created, but only with a header row.

I'm sure it's something simple I'm missing but I can't see it. Besides, it's Monday...

Thanks,

Rob
1 post Page 1 of 1