﻿<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://owl.unipharm.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Information_Systems%3AInfoNet_Data_Analyser</id>
	<title>Information Systems:InfoNet Data Analyser - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://owl.unipharm.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Information_Systems%3AInfoNet_Data_Analyser"/>
	<link rel="alternate" type="text/html" href="https://owl.unipharm.com/mediawiki/index.php?title=Information_Systems:InfoNet_Data_Analyser&amp;action=history"/>
	<updated>2026-09-01T15:16:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://owl.unipharm.com/mediawiki/index.php?title=Information_Systems:InfoNet_Data_Analyser&amp;diff=3433&amp;oldid=prev</id>
		<title>Norwinu at 20:17, 22 June 2016</title>
		<link rel="alternate" type="text/html" href="https://owl.unipharm.com/mediawiki/index.php?title=Information_Systems:InfoNet_Data_Analyser&amp;diff=3433&amp;oldid=prev"/>
		<updated>2016-06-22T20:17:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Data Analyser=&lt;br /&gt;
&lt;br /&gt;
We called it this because we planned on using ASW’s Analyser files.  Then we found it was better to use the transaction files that Analyser is based on instead.  However, the name stuck.  So keep in mind this is not ASW Analyser.&lt;br /&gt;
&lt;br /&gt;
==Sales Order Fill Rates==&lt;br /&gt;
&lt;br /&gt;
There are two versions of fill rate analysis; one uses all orders and all picking for a particular day, and the other starts with all orders on a day and follows them right through to picking.  (One difference between these is that orders received after afternoon cut off are typically picked the next day.)&lt;br /&gt;
&lt;br /&gt;
Early every morning, as part of the End of Day, WEBPRDP/BLDDAYLINE is run to accumulate all order and picking data write to files WEBPRDD/DAYLINEP and DAYLIN2P.  This program can be run for any day by calling it manually, with the date in the parameters, ie CALL  BLDDAYLINE  ‘20140801’.&lt;br /&gt;
&lt;br /&gt;
This process only includes customer orders that are picked by the warehouse.  Orders that will be picked at a future date (future orders, promos, and special orders) are handled differently than orders that will drop for picking right away.  They will not be included in any totals based on the order date, but on the picked date.&lt;br /&gt;
&lt;br /&gt;
As a regular order can be picked up to three days after it is ordered (ordered Friday evening, picked on a statutory holiday Monday), and orders under the customer’s daily order minimum can be held for up to four days, BLDDAYLINF is called, which will rebuild the previous 4 days.&lt;br /&gt;
&lt;br /&gt;
Included Order Types&lt;br /&gt;
&lt;br /&gt;
Orders that are available for picking when ordered – &lt;br /&gt;
&lt;br /&gt;
 DO – Detail Order&lt;br /&gt;
 EO – Electronic Order&lt;br /&gt;
 OR – Price Override&lt;br /&gt;
 SO – Sales Order (Manual)&lt;br /&gt;
 WO – Web Order&lt;br /&gt;
&lt;br /&gt;
Returns – &lt;br /&gt;
&lt;br /&gt;
 RT – Return from Store (non-web)&lt;br /&gt;
 WR – Web Return from Store&lt;br /&gt;
   ** these are credits, and will subtract from all totals instead of adding&lt;br /&gt;
&lt;br /&gt;
Future dated orders (added to all totals based on date picked)&lt;br /&gt;
&lt;br /&gt;
 EP – Electronic Promo Order&lt;br /&gt;
 FO – Future Order (Manual)&lt;br /&gt;
 PR – Promotional Order (Manual)&lt;br /&gt;
 SP – Special Order (Cat 900 only)&lt;br /&gt;
 WF – Web Future Order&lt;br /&gt;
 WP – Web Promo Order&lt;br /&gt;
&lt;br /&gt;
In the text below, I will call these current orders (includes returns), and future orders.&lt;br /&gt;
&lt;br /&gt;
* Sometimes electronic orders (EO), and very rarely Web Orders (WO) can act like future orders; when a customer is below their daily order minimum their orders will be held until they are over it.  These orders will be held for up to 4 days, then cancelled.  &lt;br /&gt;
&lt;br /&gt;
==Summary Data File (DAYLINEP)==&lt;br /&gt;
&lt;br /&gt;
Two sets of totals are calculated; one based on order date and the other on picked date.  Except for future dated orders; which are included in both set of totals based on picked date.  The values are broken down by warehouse / buyer / item account group.&lt;br /&gt;
&lt;br /&gt;
 DLDATE      Date (YYYYMMDD)&lt;br /&gt;
 DLYYMM      Year/Month (YYYYMM)&lt;br /&gt;
 DLFISC      Fiscal Period&lt;br /&gt;
 DLYEAR      Year&lt;br /&gt;
 DLDAYNUM    Day number (from SROCLD)&lt;br /&gt;
 DLDAY       Day of Week (Monday, Tuesday, etc)&lt;br /&gt;
 DLWHSE      Warehouse&lt;br /&gt;
 DLRESP      Buyer&lt;br /&gt;
 DLAGRP      Item account group&lt;br /&gt;
 DLONHAND    Onhand at cost&lt;br /&gt;
&lt;br /&gt;
Sales Summary by Order Date&lt;br /&gt;
&lt;br /&gt;
 DLSALESO    Sales Amount/Order Date&lt;br /&gt;
 DLSHPLNO    Lines Shipped/Order Date&lt;br /&gt;
 DLSQTYO     Quantity Shipped/Order Date&lt;br /&gt;
&lt;br /&gt;
Sales Summary by Pick Date&lt;br /&gt;
&lt;br /&gt;
 DLSALESP    Sales Amount/Pick Date&lt;br /&gt;
 DLSHPLNP    Lines Shipped/Pick Date&lt;br /&gt;
 DLSQTYP     Quantity Shipped/Pick Date&lt;br /&gt;
&lt;br /&gt;
Order Summary&lt;br /&gt;
&lt;br /&gt;
 DLORDLN     Lines Ordered (include cancelled lines and future orders)&lt;br /&gt;
 DLORDCHG    Quantity Changes&lt;br /&gt;
 DLORDCAN1   Lines cancelled because invalid&lt;br /&gt;
 DLORDCAN2   Lines cancelled because item is discontinued&lt;br /&gt;
 DLORDCAN3   Lines cancelled because out of stock&lt;br /&gt;
 DLORDCAN4   Lines cancelled by CPR (restricted or limited qty)&lt;br /&gt;
 DLORDCAN5   Lines cancelled because special order or promo item&lt;br /&gt;
 DLFUTURA    Future Dated Lines Accepted&lt;br /&gt;
 DLFUTURD    Future Dated Lines Picked&lt;br /&gt;
 DLACCLN     Lines Accepted &lt;br /&gt;
 DLORDERS    Accepted Order Amount&lt;br /&gt;
 DLNOTPCK    Order lines that have been dropped for picking, but have not &lt;br /&gt;
             yet been picked.  If this does not clear after a few days, it &lt;br /&gt;
             could mean that a current order line was accepted, but by the &lt;br /&gt;
             time it was ready to drop for picking the stock was not available,&lt;br /&gt;
             or that a customer is on credit hold.&lt;br /&gt;
&lt;br /&gt;
Fill Rates by Order Date&lt;br /&gt;
&lt;br /&gt;
 DLFFILLO    Fully Filled/Order Date&lt;br /&gt;
 DLPFILLO    Partially Filled/Order Date&lt;br /&gt;
 DLZFILLO    Zero Filled/Order Date&lt;br /&gt;
 DLCFILLO    Lines that were accepted then cancelled&lt;br /&gt;
&lt;br /&gt;
Fill Rates by Pick Date&lt;br /&gt;
&lt;br /&gt;
 DLFFILLP    Fully Filled/Pick Date&lt;br /&gt;
 DLPFILLP    Partially Filled/Pick Date&lt;br /&gt;
 DLZFILLP    Zero Filled/Pick Date&lt;br /&gt;
 DLCFILLP    Lines that were accepted then cancelled&lt;br /&gt;
&lt;br /&gt;
Summary of all Order Lines by Order Source&lt;br /&gt;
&lt;br /&gt;
 DLWEB       Web&lt;br /&gt;
 DLTRIRX     TRI-RX&lt;br /&gt;
 DLTRIP      TRI-POS&lt;br /&gt;
 DLARI       ARI&lt;br /&gt;
 DLKROLL     Kroll &lt;br /&gt;
 DLMANUAL    Manual&lt;br /&gt;
 DLSIMP      Simplicity&lt;br /&gt;
 DLTREX      T-Rex&lt;br /&gt;
 DLPOSIT     Positec&lt;br /&gt;
 DLEDISO     EDI-SO&lt;br /&gt;
&lt;br /&gt;
Summary of accepted Order Lines by Order Source&lt;br /&gt;
&lt;br /&gt;
 DLAWEB      Web/Accepted&lt;br /&gt;
 DLATRIRX    TRI-RX/Accepted&lt;br /&gt;
 DLATRIP     TRI-POS/Accepted&lt;br /&gt;
 DLAARI      ARI/Accepted&lt;br /&gt;
 DLAKROLL    Kroll/Accepted&lt;br /&gt;
 DLAMANUAL   Manual/Accepted&lt;br /&gt;
 DLASIMP     Simplicity/Accepted&lt;br /&gt;
 DLATREX     T-Rex/Accepted&lt;br /&gt;
 DLAPOSIT    Positec/Accepted&lt;br /&gt;
 DLAEDISO    EDI-SO/Accepted&lt;br /&gt;
&lt;br /&gt;
==Detail Data File (DAYLIN2P)==&lt;br /&gt;
&lt;br /&gt;
This file gives counts by reason code for order lines being cancelled or zero picked.  The difference between the two, is that ‘zero picked’ is what we have some control over; out of stock, expired, can’t fine.  ‘Cancelled’ is things that we can’t effect, like errors on the stores part (duplicate PO, bad item numbers).&lt;br /&gt;
&lt;br /&gt;
 D2DATE     Date (YYYYMMDD)&lt;br /&gt;
 D2YYMM     Year/Month (YYYYMM)&lt;br /&gt;
 D2FISC     Fiscal Period&lt;br /&gt;
 D2YEAR     Year&lt;br /&gt;
 D2DAYNUM   Day number (from SROCLD)&lt;br /&gt;
 D2DAY      Day of Week (Monday, Tuesday, etc)&lt;br /&gt;
 D2WHSE     Warehouse&lt;br /&gt;
 D2RESP     Buyer&lt;br /&gt;
 D2AGRP     Item account group&lt;br /&gt;
 D2TYPE     Type – ‘CA’ for cancelled or ‘ZP’ for zero picked&lt;br /&gt;
 D2SUBT     Sub Type – ‘ORD’ for lines not accepted at ordering, or&lt;br /&gt;
            ‘PCK’ for cancelled or zero picked after order line was accepted&lt;br /&gt;
 D2LSRN     Lost sales reason code&lt;br /&gt;
 D2COUNT    Count of order lines&lt;br /&gt;
&lt;br /&gt;
==RPG program BLDDAYLINE== &lt;br /&gt;
&lt;br /&gt;
Files used – &lt;br /&gt;
&lt;br /&gt;
 SROISDPL      – Invoice Lines&lt;br /&gt;
 SROSRO        – Warehouse balances&lt;br /&gt;
 SROORSHE      – Sales order header&lt;br /&gt;
 SROORSPL      – Sales order line&lt;br /&gt;
 IOPHDRP       – IOP order header&lt;br /&gt;
 IOPLINP       – IOP order line &lt;br /&gt;
&lt;br /&gt;
Totals are summarized by date / warehouse / buyer / item account group.&lt;br /&gt;
&lt;br /&gt;
===Total onhand=== &lt;br /&gt;
&lt;br /&gt;
Read warehouse file and calculate total on hand value at average cost.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select srsrom, itresp, itagrp, sum(srsthq * srapco) &lt;br /&gt;
from srosro, xxitemp &lt;br /&gt;
where srprdc = itprdc and srsthq &amp;lt;&amp;gt; 0 &lt;br /&gt;
group by srsrom, itresp, itagrp &lt;br /&gt;
order by srsrom, itresp, itagrp                             &lt;br /&gt;
&lt;br /&gt;
Result moved to DLONHAND.&lt;br /&gt;
&lt;br /&gt;
===Sales Summary by order date===&lt;br /&gt;
&lt;br /&gt;
Link invoice lines to the sales order header, and summarize amount and line count by debit/credit flag and order type.  The invoice file includes the item account group, so only include records for inventory items (item account group starts with ‘I’), by order date (from the sales order header).&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, sum(idamou), count(*), sum(idqty) &lt;br /&gt;
from sroisdpl, sroorshe &lt;br /&gt;
where idorno = ohorno and ohoush = 'Y' and idpagr &amp;lt; 'I999' and ohodat = 20140702             &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt                         &lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt  &lt;br /&gt;
                       &lt;br /&gt;
When idtypp (debit/credit flag) is ‘2’, reverse accumulators.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLSALESO, DLSHPLNO, AND DLSQTYO.&lt;br /&gt;
&lt;br /&gt;
Future orders are not added here, as they are added based on date picked.&lt;br /&gt;
&lt;br /&gt;
===Sales summary by pick date===&lt;br /&gt;
&lt;br /&gt;
Read invoice file, and summarize amount and line count by debit/credit flag and order type.  TThe invoice file includes the item account group, so only include records for inventory items (item account group starts with ‘I’), by invoice date (which is the date picked).&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, sum(idamou), count(*), sum(idqty) &lt;br /&gt;
from sroisdpl &lt;br /&gt;
where ididat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp (debit/credit flag) is ‘2’, reverse accumulators.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLSALESP, DLSHPLNP, AND DLSQTYP.&lt;br /&gt;
&lt;br /&gt;
Future orders are also added to sales by order date (DLSALESO, DLSHPLNO, DKSQTYO), future orders picked (DLFUTURD), and accepted orders (DLORDERS, DLACCLN).  &lt;br /&gt;
&lt;br /&gt;
===Get accepted order lines=== &lt;br /&gt;
&lt;br /&gt;
Link the sales order headers to sales order lines, and summarize the order value and line count by order type and handler.  &lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, ohhand, sum(oloqts*olsalp), count(*)&lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc  = itprdc and olprdc &amp;lt;&amp;gt; '02000040' and ohodat = 20140702 and ohoush = 'Y' &lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt, ohhand&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt, ohhand&lt;br /&gt;
&lt;br /&gt;
All orders add to DLORDLN.&lt;br /&gt;
&lt;br /&gt;
All current orders add to DLORDERS and DLACCLN.&lt;br /&gt;
&lt;br /&gt;
All future orders add to DLFUTURA.&lt;br /&gt;
&lt;br /&gt;
WO, WP, WR, and WF add to DLWEB and DLAWEB.&lt;br /&gt;
&lt;br /&gt;
EO and EP are accumulated by source – &lt;br /&gt;
&lt;br /&gt;
 EDI-ARI adds to DLAARI and DLARI.&lt;br /&gt;
 EDI-KROLL adds to DLAKROLL and DLKROLL.&lt;br /&gt;
 EDI-POSITE adds to DLAPOSIT and DLPOSIT.&lt;br /&gt;
 EDI-SIMPLI adds to DLASIMP and DLSIMP.&lt;br /&gt;
 EDI-TREX adds to DLATREX and DLTREX.&lt;br /&gt;
 EDI-TRIPOS adds to DLATRIP and DLTRIP.&lt;br /&gt;
 EDI-TRIRX adds to DLATRIRX and DLREIRX.&lt;br /&gt;
 Anything else (there shouldn’t be) adds to DLAEDISO and DLEDISO.&lt;br /&gt;
&lt;br /&gt;
DO, FO, OR, PR, RA, RT, SO, and SP add to DLAMANUAL and DLMANUAL.&lt;br /&gt;
&lt;br /&gt;
===Get cancelled and changed order lines=== &lt;br /&gt;
&lt;br /&gt;
Link the IOP header and line files together, and count number of lines per various error flags.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi, count(*) &lt;br /&gt;
from iophdrp left outer join ioplinp on iophdrp.ihunin = ioplinp.ihunin left outer join  xxitemp on iditem = itprdc &lt;br /&gt;
where ihcryr = 14 and ihcrce = 20 and (idpafi = 'Y' or idaswo = 0) and ihcrmo = 07 and ihsrce &amp;lt;&amp;gt; 'MISCBIL' and ihcrdy = 02 &lt;br /&gt;
group by itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi &lt;br /&gt;
order by itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi                                                               &lt;br /&gt;
&lt;br /&gt;
This will return counts of order lines that have either had the quantity changed, or have not posted to ASW.&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is ‘Y’, add lines to DLORDCHG. &lt;br /&gt;
&lt;br /&gt;
Otherwise, add lines to DLORDLN, and by source (IDSRCE) add lines to the applicable summary of order lines field (ie DLARI, DLSIMP).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, and IDCPQT (quantity changed by CPR) is ‘Y’ add lines to DLORDCAN4 (cancelled by CPR).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘S’ add lines to DLORDCAN5 (special order or promo item).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘A’ or ‘B’ add lines to DLORDCAN3 (out of stock).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘P’ or ‘R’ add lines to DLORDCAN4 (cancelled by CPR).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is not ‘A’, ‘B’, ‘P’, or ‘R’ add lines to DLORDCAN2 (discontinued).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is not ‘Y’, and IDSTAT (status code) is ‘50’ add lines to DLORDCAN5 (special order or promo item).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, but record does not fit into any of the above categories, add lines to DLORDCAN4 (error).&lt;br /&gt;
&lt;br /&gt;
===Get fully filled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity equals the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) from sroisdpl, sroorspl, sroorshe &lt;br /&gt;
where idorno = olorno and idolin = olline and idorno = ohorno and idqty = oloqts and ohodat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt                         &lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLFFILLO.  Future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
===Get partially filled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity does not equal the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from sroisdpl, sroorspl, sroorshe &lt;br /&gt;
where idorno = olorno and idolin = olline and idorno = ohorno and idqty &amp;lt;&amp;gt; oloqts and ohodat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLPFILLO.  Future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
===Get zero filled and cancelled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get lines from the lost sales file linked to the sales order line, and based on the sales order date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select lssrom, itresp, lspagr, lsordt, lsplno, lslsrn, olcqts, olstat, olords &lt;br /&gt;
from srolstsl, sroorspl, xxitemp  &lt;br /&gt;
where lsorno = olorno and lsline = olline and lsprdc = itprdc and olrddt = 20140702&lt;br /&gt;
&lt;br /&gt;
Include current orders only; future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
Returns (LSORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
If OLCQTS (confirmed quantity from sales order line) is not zero, this line was a partial pick, which has already been counted, so ignore it here.&lt;br /&gt;
&lt;br /&gt;
If LSLSRN (lost sales reason code) is ‘A’, ‘B’, ‘1’, ‘2’, ‘3’, or ‘5’ add to DLZFILLO (zero filled by order date.  Otherwise add to DLCFILLO (cancelled after being accepted as order).&lt;br /&gt;
&lt;br /&gt;
===Get fully filled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity equals the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from  sroisdpl, sroorspl &lt;br /&gt;
where idorno = olorno and idolin = olline and idpagr &amp;lt; 'I999' and idqty = oloqts and ididat = 20140702&lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLFFILLP.  Future orders are also added to DLFFILLO.&lt;br /&gt;
&lt;br /&gt;
===Get partially filled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity does not equal the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from sroisdpl, sroorspl &lt;br /&gt;
where idorno = olorno and idolin = olline and idpagr &amp;lt; 'I999' and idqty &amp;lt;&amp;gt; oloqts and ididat = 20140702&lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLPFILLP.  Future orders are also added to DLPFILLO.&lt;br /&gt;
&lt;br /&gt;
===Get zero filled and cancelled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get lines from the lost sales file linked to the sales order line, and based on the lost sales date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select lssrom, itresp, lspagr, lsordt, lsplno, lslsrn, olcqts, olstat, olords &lt;br /&gt;
from srolstsl, sroorspl, xxitemp&lt;br /&gt;
where lsorno = olorno and lsline = olline and lsprdc = itprdc and lslsdt = 20140702&lt;br /&gt;
&lt;br /&gt;
Current and future orders are included.&lt;br /&gt;
&lt;br /&gt;
Returns (LSORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
If OLCQTS (confirmed quantity from sales order line) is not zero, this line was a partial pick, which has already been counted, so ignore it here.&lt;br /&gt;
&lt;br /&gt;
If LSLSRN (lost sales reason code) is ‘A’, ‘B’, ‘1’, ‘2’, ‘3’, or ‘5’ add to DLZFILLP (zero filled by order date.  Otherwise add to DLCFILLP (cancelled after being accepted as order).&lt;br /&gt;
&lt;br /&gt;
===Get Current Orders Not Picked by Order Date===&lt;br /&gt;
&lt;br /&gt;
From the ASW sales order files, read active order lines that have not yet been picked but were ordered on the requested date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, count(*) &lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc = itprdc and ohstat = ' ' and olstat = ' ' and olords &amp;lt;= 30 and ohodat = 20170702&lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
&lt;br /&gt;
Returns (OHORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
Add lines for current orders to DLNOTPCK.&lt;br /&gt;
&lt;br /&gt;
===Get Future Order Not Picked by Expected Dispatch Date===&lt;br /&gt;
&lt;br /&gt;
From the ASW sales order files, read active order lines that have not yet been picked but had a dispatch date of the requested date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, count(*) &lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc = itprdc and ohstat = ' ' and olstat = ' ' and olords &amp;lt;= 30 and oldelt = 20140702&lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
&lt;br /&gt;
Add lines for future orders to DLNOTPCK.&lt;br /&gt;
&lt;br /&gt;
[[Category: Infonet]]&lt;/div&gt;</summary>
		<author><name>Norwinu</name></author>
	</entry>
	<entry>
		<id>https://owl.unipharm.com/mediawiki/index.php?title=Information_Systems:InfoNet_Data_Analyser&amp;diff=705&amp;oldid=prev</id>
		<title>172.30.20.117: Created page with &quot;=Data Analyser=  We called it this because we planned on using ASW’s Analyser files.  Then we found it was better to use the transaction files that Analyser is based on inst...&quot;</title>
		<link rel="alternate" type="text/html" href="https://owl.unipharm.com/mediawiki/index.php?title=Information_Systems:InfoNet_Data_Analyser&amp;diff=705&amp;oldid=prev"/>
		<updated>2015-10-21T00:14:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Data Analyser=  We called it this because we planned on using ASW’s Analyser files.  Then we found it was better to use the transaction files that Analyser is based on inst...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Data Analyser=&lt;br /&gt;
&lt;br /&gt;
We called it this because we planned on using ASW’s Analyser files.  Then we found it was better to use the transaction files that Analyser is based on instead.  However, the name stuck.  So keep in mind this is not ASW Analyser.&lt;br /&gt;
&lt;br /&gt;
==Sales Order Fill Rates==&lt;br /&gt;
&lt;br /&gt;
There are two versions of fill rate analysis; one uses all orders and all picking for a particular day, and the other starts with all orders on a day and follows them right through to picking.  (One difference between these is that orders received after afternoon cut off are typically picked the next day.)&lt;br /&gt;
&lt;br /&gt;
Early every morning, as part of the End of Day, WEBPRDP/BLDDAYLINE is run to accumulate all order and picking data write to files WEBPRDD/DAYLINEP and DAYLIN2P.  This program can be run for any day by calling it manually, with the date in the parameters, ie CALL  BLDDAYLINE  ‘20140801’.&lt;br /&gt;
&lt;br /&gt;
This process only includes customer orders that are picked by the warehouse.  Orders that will be picked at a future date (future orders, promos, and special orders) are handled differently than orders that will drop for picking right away.  They will not be included in any totals based on the order date, but on the picked date.&lt;br /&gt;
&lt;br /&gt;
As a regular order can be picked up to three days after it is ordered (ordered Friday evening, picked on a statutory holiday Monday), and orders under the customer’s daily order minimum can be held for up to four days, BLDDAYLINF is called, which will rebuild the previous 4 days.&lt;br /&gt;
&lt;br /&gt;
Included Order Types&lt;br /&gt;
&lt;br /&gt;
Orders that are available for picking when ordered – &lt;br /&gt;
&lt;br /&gt;
 DO – Detail Order&lt;br /&gt;
 EO – Electronic Order&lt;br /&gt;
 OR – Price Override&lt;br /&gt;
 SO – Sales Order (Manual)&lt;br /&gt;
 WO – Web Order&lt;br /&gt;
&lt;br /&gt;
Returns – &lt;br /&gt;
&lt;br /&gt;
 RT – Return from Store (non-web)&lt;br /&gt;
 WR – Web Return from Store&lt;br /&gt;
   ** these are credits, and will subtract from all totals instead of adding&lt;br /&gt;
&lt;br /&gt;
Future dated orders (added to all totals based on date picked)&lt;br /&gt;
&lt;br /&gt;
 EP – Electronic Promo Order&lt;br /&gt;
 FO – Future Order (Manual)&lt;br /&gt;
 PR – Promotional Order (Manual)&lt;br /&gt;
 SP – Special Order (Cat 900 only)&lt;br /&gt;
 WF – Web Future Order&lt;br /&gt;
 WP – Web Promo Order&lt;br /&gt;
&lt;br /&gt;
In the text below, I will call these current orders (includes returns), and future orders.&lt;br /&gt;
&lt;br /&gt;
* Sometimes electronic orders (EO), and very rarely Web Orders (WO) can act like future orders; when a customer is below their daily order minimum their orders will be held until they are over it.  These orders will be held for up to 4 days, then cancelled.  &lt;br /&gt;
&lt;br /&gt;
==Summary Data File (DAYLINEP)==&lt;br /&gt;
&lt;br /&gt;
Two sets of totals are calculated; one based on order date and the other on picked date.  Except for future dated orders; which are included in both set of totals based on picked date.  The values are broken down by warehouse / buyer / item account group.&lt;br /&gt;
&lt;br /&gt;
 DLDATE      Date (YYYYMMDD)&lt;br /&gt;
 DLYYMM      Year/Month (YYYYMM)&lt;br /&gt;
 DLFISC      Fiscal Period&lt;br /&gt;
 DLYEAR      Year&lt;br /&gt;
 DLDAYNUM    Day number (from SROCLD)&lt;br /&gt;
 DLDAY       Day of Week (Monday, Tuesday, etc)&lt;br /&gt;
 DLWHSE      Warehouse&lt;br /&gt;
 DLRESP      Buyer&lt;br /&gt;
 DLAGRP      Item account group&lt;br /&gt;
 DLONHAND    Onhand at cost&lt;br /&gt;
&lt;br /&gt;
Sales Summary by Order Date&lt;br /&gt;
&lt;br /&gt;
 DLSALESO    Sales Amount/Order Date&lt;br /&gt;
 DLSHPLNO    Lines Shipped/Order Date&lt;br /&gt;
 DLSQTYO     Quantity Shipped/Order Date&lt;br /&gt;
&lt;br /&gt;
Sales Summary by Pick Date&lt;br /&gt;
&lt;br /&gt;
 DLSALESP    Sales Amount/Pick Date&lt;br /&gt;
 DLSHPLNP    Lines Shipped/Pick Date&lt;br /&gt;
 DLSQTYP     Quantity Shipped/Pick Date&lt;br /&gt;
&lt;br /&gt;
Order Summary&lt;br /&gt;
&lt;br /&gt;
 DLORDLN     Lines Ordered (include cancelled lines and future orders)&lt;br /&gt;
 DLORDCHG    Quantity Changes&lt;br /&gt;
 DLORDCAN1   Lines cancelled because invalid&lt;br /&gt;
 DLORDCAN2   Lines cancelled because item is discontinued&lt;br /&gt;
 DLORDCAN3   Lines cancelled because out of stock&lt;br /&gt;
 DLORDCAN4   Lines cancelled by CPR (restricted or limited qty)&lt;br /&gt;
 DLORDCAN5   Lines cancelled because special order or promo item&lt;br /&gt;
 DLFUTURA    Future Dated Lines Accepted&lt;br /&gt;
 DLFUTURD    Future Dated Lines Picked&lt;br /&gt;
 DLACCLN     Lines Accepted &lt;br /&gt;
 DLORDERS    Accepted Order Amount&lt;br /&gt;
 DLNOTPCK    Order lines that have been dropped for picking, but have not &lt;br /&gt;
             yet been picked.  If this does not clear after a few days, it &lt;br /&gt;
             could mean that a current order line was accepted, but by the &lt;br /&gt;
             time it was ready to drop for picking the stock was not available,&lt;br /&gt;
             or that a customer is on credit hold.&lt;br /&gt;
&lt;br /&gt;
Fill Rates by Order Date&lt;br /&gt;
&lt;br /&gt;
 DLFFILLO    Fully Filled/Order Date&lt;br /&gt;
 DLPFILLO    Partially Filled/Order Date&lt;br /&gt;
 DLZFILLO    Zero Filled/Order Date&lt;br /&gt;
 DLCFILLO    Lines that were accepted then cancelled&lt;br /&gt;
&lt;br /&gt;
Fill Rates by Pick Date&lt;br /&gt;
&lt;br /&gt;
 DLFFILLP    Fully Filled/Pick Date&lt;br /&gt;
 DLPFILLP    Partially Filled/Pick Date&lt;br /&gt;
 DLZFILLP    Zero Filled/Pick Date&lt;br /&gt;
 DLCFILLP    Lines that were accepted then cancelled&lt;br /&gt;
&lt;br /&gt;
Summary of all Order Lines by Order Source&lt;br /&gt;
&lt;br /&gt;
 DLWEB       Web&lt;br /&gt;
 DLTRIRX     TRI-RX&lt;br /&gt;
 DLTRIP      TRI-POS&lt;br /&gt;
 DLARI       ARI&lt;br /&gt;
 DLKROLL     Kroll &lt;br /&gt;
 DLMANUAL    Manual&lt;br /&gt;
 DLSIMP      Simplicity&lt;br /&gt;
 DLTREX      T-Rex&lt;br /&gt;
 DLPOSIT     Positec&lt;br /&gt;
 DLEDISO     EDI-SO&lt;br /&gt;
&lt;br /&gt;
Summary of accepted Order Lines by Order Source&lt;br /&gt;
&lt;br /&gt;
 DLAWEB      Web/Accepted&lt;br /&gt;
 DLATRIRX    TRI-RX/Accepted&lt;br /&gt;
 DLATRIP     TRI-POS/Accepted&lt;br /&gt;
 DLAARI      ARI/Accepted&lt;br /&gt;
 DLAKROLL    Kroll/Accepted&lt;br /&gt;
 DLAMANUAL   Manual/Accepted&lt;br /&gt;
 DLASIMP     Simplicity/Accepted&lt;br /&gt;
 DLATREX     T-Rex/Accepted&lt;br /&gt;
 DLAPOSIT    Positec/Accepted&lt;br /&gt;
 DLAEDISO    EDI-SO/Accepted&lt;br /&gt;
&lt;br /&gt;
==Detail Data File (DAYLIN2P)==&lt;br /&gt;
&lt;br /&gt;
This file gives counts by reason code for order lines being cancelled or zero picked.  The difference between the two, is that ‘zero picked’ is what we have some control over; out of stock, expired, can’t fine.  ‘Cancelled’ is things that we can’t effect, like errors on the stores part (duplicate PO, bad item numbers).&lt;br /&gt;
&lt;br /&gt;
 D2DATE     Date (YYYYMMDD)&lt;br /&gt;
 D2YYMM     Year/Month (YYYYMM)&lt;br /&gt;
 D2FISC     Fiscal Period&lt;br /&gt;
 D2YEAR     Year&lt;br /&gt;
 D2DAYNUM   Day number (from SROCLD)&lt;br /&gt;
 D2DAY      Day of Week (Monday, Tuesday, etc)&lt;br /&gt;
 D2WHSE     Warehouse&lt;br /&gt;
 D2RESP     Buyer&lt;br /&gt;
 D2AGRP     Item account group&lt;br /&gt;
 D2TYPE     Type – ‘CA’ for cancelled or ‘ZP’ for zero picked&lt;br /&gt;
 D2SUBT     Sub Type – ‘ORD’ for lines not accepted at ordering, or&lt;br /&gt;
            ‘PCK’ for cancelled or zero picked after order line was accepted&lt;br /&gt;
 D2LSRN     Lost sales reason code&lt;br /&gt;
 D2COUNT    Count of order lines&lt;br /&gt;
&lt;br /&gt;
==RPG program BLDDAYLINE== &lt;br /&gt;
&lt;br /&gt;
Files used – &lt;br /&gt;
&lt;br /&gt;
 SROISDPL      – Invoice Lines&lt;br /&gt;
 SROSRO        – Warehouse balances&lt;br /&gt;
 SROORSHE      – Sales order header&lt;br /&gt;
 SROORSPL      – Sales order line&lt;br /&gt;
 IOPHDRP       – IOP order header&lt;br /&gt;
 IOPLINP       – IOP order line &lt;br /&gt;
&lt;br /&gt;
Totals are summarized by date / warehouse / buyer / item account group.&lt;br /&gt;
&lt;br /&gt;
===Total onhand=== &lt;br /&gt;
&lt;br /&gt;
Read warehouse file and calculate total on hand value at average cost.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select srsrom, itresp, itagrp, sum(srsthq * srapco) &lt;br /&gt;
from srosro, xxitemp &lt;br /&gt;
where srprdc = itprdc and srsthq &amp;lt;&amp;gt; 0 &lt;br /&gt;
group by srsrom, itresp, itagrp &lt;br /&gt;
order by srsrom, itresp, itagrp                             &lt;br /&gt;
&lt;br /&gt;
Result moved to DLONHAND.&lt;br /&gt;
&lt;br /&gt;
===Sales Summary by order date===&lt;br /&gt;
&lt;br /&gt;
Link invoice lines to the sales order header, and summarize amount and line count by debit/credit flag and order type.  The invoice file includes the item account group, so only include records for inventory items (item account group starts with ‘I’), by order date (from the sales order header).&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, sum(idamou), count(*), sum(idqty) &lt;br /&gt;
from sroisdpl, sroorshe &lt;br /&gt;
where idorno = ohorno and ohoush = 'Y' and idpagr &amp;lt; 'I999' and ohodat = 20140702             &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt                         &lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt  &lt;br /&gt;
                       &lt;br /&gt;
When idtypp (debit/credit flag) is ‘2’, reverse accumulators.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLSALESO, DLSHPLNO, AND DLSQTYO.&lt;br /&gt;
&lt;br /&gt;
Future orders are not added here, as they are added based on date picked.&lt;br /&gt;
&lt;br /&gt;
===Sales summary by pick date===&lt;br /&gt;
&lt;br /&gt;
Read invoice file, and summarize amount and line count by debit/credit flag and order type.  TThe invoice file includes the item account group, so only include records for inventory items (item account group starts with ‘I’), by invoice date (which is the date picked).&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, sum(idamou), count(*), sum(idqty) &lt;br /&gt;
from sroisdpl &lt;br /&gt;
where ididat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp (debit/credit flag) is ‘2’, reverse accumulators.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLSALESP, DLSHPLNP, AND DLSQTYP.&lt;br /&gt;
&lt;br /&gt;
Future orders are also added to sales by order date (DLSALESO, DLSHPLNO, DKSQTYO), future orders picked (DLFUTURD), and accepted orders (DLORDERS, DLACCLN).  &lt;br /&gt;
&lt;br /&gt;
===Get accepted order lines=== &lt;br /&gt;
&lt;br /&gt;
Link the sales order headers to sales order lines, and summarize the order value and line count by order type and handler.  &lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, ohhand, sum(oloqts*olsalp), count(*)&lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc  = itprdc and olprdc &amp;lt;&amp;gt; '02000040' and ohodat = 20140702 and ohoush = 'Y' &lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt, ohhand&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt, ohhand&lt;br /&gt;
&lt;br /&gt;
All orders add to DLORDLN.&lt;br /&gt;
&lt;br /&gt;
All current orders add to DLORDERS and DLACCLN.&lt;br /&gt;
&lt;br /&gt;
All future orders add to DLFUTURA.&lt;br /&gt;
&lt;br /&gt;
WO, WP, WR, and WF add to DLWEB and DLAWEB.&lt;br /&gt;
&lt;br /&gt;
EO and EP are accumulated by source – &lt;br /&gt;
&lt;br /&gt;
 EDI-ARI adds to DLAARI and DLARI.&lt;br /&gt;
 EDI-KROLL adds to DLAKROLL and DLKROLL.&lt;br /&gt;
 EDI-POSITE adds to DLAPOSIT and DLPOSIT.&lt;br /&gt;
 EDI-SIMPLI adds to DLASIMP and DLSIMP.&lt;br /&gt;
 EDI-TREX adds to DLATREX and DLTREX.&lt;br /&gt;
 EDI-TRIPOS adds to DLATRIP and DLTRIP.&lt;br /&gt;
 EDI-TRIRX adds to DLATRIRX and DLREIRX.&lt;br /&gt;
 Anything else (there shouldn’t be) adds to DLAEDISO and DLEDISO.&lt;br /&gt;
&lt;br /&gt;
DO, FO, OR, PR, RA, RT, SO, and SP add to DLAMANUAL and DLMANUAL.&lt;br /&gt;
&lt;br /&gt;
===Get cancelled and changed order lines=== &lt;br /&gt;
&lt;br /&gt;
Link the IOP header and line files together, and count number of lines per various error flags.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi, count(*) &lt;br /&gt;
from iophdrp left outer join ioplinp on iophdrp.ihunin = ioplinp.ihunin left outer join  xxitemp on iditem = itprdc &lt;br /&gt;
where ihcryr = 14 and ihcrce = 20 and (idpafi = 'Y' or idaswo = 0) and ihcrmo = 07 and ihsrce &amp;lt;&amp;gt; 'MISCBIL' and ihcrdy = 02 &lt;br /&gt;
group by itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi &lt;br /&gt;
order by itresp, itagrp, ihsrce, idlspo, idcpqt, idlsre, idstat, idpafi, idnofi                                                               &lt;br /&gt;
&lt;br /&gt;
This will return counts of order lines that have either had the quantity changed, or have not posted to ASW.&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is ‘Y’, add lines to DLORDCHG. &lt;br /&gt;
&lt;br /&gt;
Otherwise, add lines to DLORDLN, and by source (IDSRCE) add lines to the applicable summary of order lines field (ie DLARI, DLSIMP).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, and IDCPQT (quantity changed by CPR) is ‘Y’ add lines to DLORDCAN4 (cancelled by CPR).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘S’ add lines to DLORDCAN5 (special order or promo item).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘A’ or ‘B’ add lines to DLORDCAN3 (out of stock).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is ‘P’ or ‘R’ add lines to DLORDCAN4 (cancelled by CPR).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is ‘Y’, and IDLSRE (lost sales reason code) is not ‘A’, ‘B’, ‘P’, or ‘R’ add lines to DLORDCAN2 (discontinued).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, IDCPQT (quantity changed by CPR) is not ‘Y’, IDLSPO (posted to lost sales) is not ‘Y’, and IDSTAT (status code) is ‘50’ add lines to DLORDCAN5 (special order or promo item).&lt;br /&gt;
&lt;br /&gt;
If IDPAFI (partially filled) is not ‘Y’, but record does not fit into any of the above categories, add lines to DLORDCAN4 (error).&lt;br /&gt;
&lt;br /&gt;
===Get fully filled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity equals the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) from sroisdpl, sroorspl, sroorshe &lt;br /&gt;
where idorno = olorno and idolin = olline and idorno = ohorno and idqty = oloqts and ohodat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt                         &lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLFFILLO.  Future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
===Get partially filled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity does not equal the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from sroisdpl, sroorspl, sroorshe &lt;br /&gt;
where idorno = olorno and idolin = olline and idorno = ohorno and idqty &amp;lt;&amp;gt; oloqts and ohodat = 20140702 and idpagr &amp;lt; 'I999' &lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current orders are added to DLPFILLO.  Future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
===Get zero filled and cancelled by order date=== &lt;br /&gt;
&lt;br /&gt;
Get lines from the lost sales file linked to the sales order line, and based on the sales order date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select lssrom, itresp, lspagr, lsordt, lsplno, lslsrn, olcqts, olstat, olords &lt;br /&gt;
from srolstsl, sroorspl, xxitemp  &lt;br /&gt;
where lsorno = olorno and lsline = olline and lsprdc = itprdc and olrddt = 20140702&lt;br /&gt;
&lt;br /&gt;
Include current orders only; future orders will be added based on picked date.&lt;br /&gt;
&lt;br /&gt;
Returns (LSORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
If OLCQTS (confirmed quantity from sales order line) is not zero, this line was a partial pick, which has already been counted, so ignore it here.&lt;br /&gt;
&lt;br /&gt;
If LSLSRN (lost sales reason code) is ‘A’, ‘B’, ‘1’, ‘2’, ‘3’, or ‘5’ add to DLZFILLO (zero filled by order date.  Otherwise add to DLCFILLO (cancelled after being accepted as order).&lt;br /&gt;
&lt;br /&gt;
===Get fully filled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity equals the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from  sroisdpl, sroorspl &lt;br /&gt;
where idorno = olorno and idolin = olline and idpagr &amp;lt; 'I999' and idqty = oloqts and ididat = 20140702&lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLFFILLP.  Future orders are also added to DLFFILLO.&lt;br /&gt;
&lt;br /&gt;
===Get partially filled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get count of lines where the sales order quantity does not equal the invoice quantity.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select idsrom, idresp, idpagr, idtypp, idordt, count(*) &lt;br /&gt;
from sroisdpl, sroorspl &lt;br /&gt;
where idorno = olorno and idolin = olline and idpagr &amp;lt; 'I999' and idqty &amp;lt;&amp;gt; oloqts and ididat = 20140702&lt;br /&gt;
group by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
order by idsrom, idresp, idpagr, idtypp, idordt&lt;br /&gt;
&lt;br /&gt;
When idtypp is ‘2’, subtract instead of adding.&lt;br /&gt;
&lt;br /&gt;
Current and future orders are added to DLPFILLP.  Future orders are also added to DLPFILLO.&lt;br /&gt;
&lt;br /&gt;
===Get zero filled and cancelled by picked date=== &lt;br /&gt;
&lt;br /&gt;
Get lines from the lost sales file linked to the sales order line, and based on the lost sales date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select lssrom, itresp, lspagr, lsordt, lsplno, lslsrn, olcqts, olstat, olords &lt;br /&gt;
from srolstsl, sroorspl, xxitemp&lt;br /&gt;
where lsorno = olorno and lsline = olline and lsprdc = itprdc and lslsdt = 20140702&lt;br /&gt;
&lt;br /&gt;
Current and future orders are included.&lt;br /&gt;
&lt;br /&gt;
Returns (LSORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
If OLCQTS (confirmed quantity from sales order line) is not zero, this line was a partial pick, which has already been counted, so ignore it here.&lt;br /&gt;
&lt;br /&gt;
If LSLSRN (lost sales reason code) is ‘A’, ‘B’, ‘1’, ‘2’, ‘3’, or ‘5’ add to DLZFILLP (zero filled by order date.  Otherwise add to DLCFILLP (cancelled after being accepted as order).&lt;br /&gt;
&lt;br /&gt;
===Get Current Orders Not Picked by Order Date===&lt;br /&gt;
&lt;br /&gt;
From the ASW sales order files, read active order lines that have not yet been picked but were ordered on the requested date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, count(*) &lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc = itprdc and ohstat = ' ' and olstat = ' ' and olords &amp;lt;= 30 and ohodat = 20170702&lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
&lt;br /&gt;
Returns (OHORDT equals ‘RT’ or ‘WR’) subtract instead of add.&lt;br /&gt;
&lt;br /&gt;
Add lines for current orders to DLNOTPCK.&lt;br /&gt;
&lt;br /&gt;
===Get Future Order Not Picked by Expected Dispatch Date===&lt;br /&gt;
&lt;br /&gt;
From the ASW sales order files, read active order lines that have not yet been picked but had a dispatch date of the requested date.&lt;br /&gt;
&lt;br /&gt;
SQL – &lt;br /&gt;
select ohsrom, itresp, itagrp, ohordt, count(*) &lt;br /&gt;
from sroorshe, sroorspl, xxitemp &lt;br /&gt;
where ohorno = olorno and olprdc = itprdc and ohstat = ' ' and olstat = ' ' and olords &amp;lt;= 30 and oldelt = 20140702&lt;br /&gt;
group by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
order by ohsrom, itresp, itagrp, ohordt&lt;br /&gt;
&lt;br /&gt;
Add lines for future orders to DLNOTPCK.&lt;/div&gt;</summary>
		<author><name>172.30.20.117</name></author>
	</entry>
</feed>