What command in TCL would prevent redundancy? (AREV Specific)
At 15 MAR 2000 10:36:57AM Marla DeFreese wrote:
What can I include in this TCL command below that would display the vendor, vendor.name, and vendor.address only once for each vendor, yet allow the multiple invoice amounts to be displayed?
SORT PURCHASES BY VENDOR BREAK-ON VENDOR "TOTAL 'UUV'" WITH INV.DATE GE "01/01/99" AND WITH INV.DATE LE "12/31/99" VENDOR.NAME VENDOR.ADDRESS TOTAL AMT GRAND-TOTAL "GRAND-TOTAL 'UU'" ID-SUPP
Thank you.
Marla
At 15 MAR 2000 11:52AM Don Miller - C3 Inc. wrote:
Marla ..
Unless you want to waste paper, it isn't do-able with RLIST. If you were to opt to force a page-break on change of Vendor then you could do it with a multi-line symbolic for the vendor which would include vendor name, address city-state, zip
The trick on this is to use CR/LF's in the symbolic instead of value-marks or text marks:
* DICT SYMBOLIC WHICH WORKS IN REPORT HEADERS
* THE DICT NAME IS NAC_HDR
Equ CRLF to \0D0A\
XX={VENDOR_NAME}
YY={VENDOR_ADDRESS}
ZZ={VENDOR_CITY}
ST={VENDOR_STATE}
ZP={VENDOR_ZIP}
@ANS=' ;* CLEAR OUT FROM SYMBOLIC CALLS ABOVE
IF LEN(XX) THEN @ANS:=XX
IF LEN(YY) THEN
IF LEN(@ANS) THEN @ANS:=CRLF@ANS:=YYEND
CSZ=ZZ:', ':ST:' ':ZP
IF LEN(ZZ) THEN
IF LEN(@ANS) THEN @ANS:=CRLF@ANS:=CSZEND
NOW IF YOU LIST SOMEFILE BY VENDOR WITH DATE1 FROM 'MM/DD/YY' TO 'MM/DD/YY' TOTAL SOMETHING DATE1 … BREAK-ON NAC_HDR "'PB'" JUSTLEN "L#0" HEADING "'B'" SHOULD WORK. I'M NOT SURE IF THIS IS EXACTLY RIGHT, BUT WE DO SOMETHING LIKE THIS IN A NUMBER OF REPORTS
HTH
Don Miller
C3 Inc.
At 15 MAR 2000 04:59PM Frank S. Adamo wrote:
You really can't do what you want to do by a RLIST. I would suggest that you save the list by including a "(X)" to the LIST line, i.e. LIST FILE_NAME PARAMETERS (X).
If you haven't done this sort of process before, I would suggest that you create a "BP" file, i.e. a file to hold your Basic Programming files.
After you have save the list, you can go into the saved list and edit the program. You will find that the list statement, i.e. LIST FILE_NAME PARAMETERS is "*",d. You would need to modified the line to:
PERFORM "SELECT xxx" where xxx is the selection process in the LIST statement. After you have done that, then you can go down near the bottom of the program and modify the program to print only the vendor or customer information on one line and the data for that cust/vendor on multiple lines. I have done that many times. If you would like an example, please let me know.
I would also suggest you print the program to the printer to view the structure of the program. If you are not familiar with the structure, then the modification to the program may be difficult. Believe me, you can do wonders by saving a LIST and modifying the saved LIST program.
If you have any questions, please cc: to [email protected] as I do not check this online discussion all that often.
Regards,
Frank
At 30 MAR 2000 10:57AM Linda Yunashko wrote:
You can do this with RLIST by adding some fields to your dictionary. You'll need to set aside one (or part) of the @USER or @RECUR variables. I'll use @USER1 and @USER1 to illustrate.
Create a synonym for VENDOR.NAME with a 0 display length. You'll use this for your break-on (unless you don't want to break on vendor name, in which case you can skip this step). I'll call this VENDOR0.
Create a symbolic (I'll call it VENDOR.DISPLAY) with the formula:
@ANS='
NAME={VENDOR.NAME}
USER =@USER1
IF NAME # USER THEN
@USER1=NAME@ANS=NAMEEND
Create another one (I'll call it ADDRESS.DISPLAY) with the formula:
@ANS='
ADDR={VENDOR.ADDRESS}
USER=@USER1
IF ADDR # USER THEN
@USER1=ADDR@ANS=ADDREND
Your RLIST statement would look like this:
LIST PURCHASES BY VENDOR.NAME BREAK-ON VENDOR0 VENDOR.DISPLAY ADDRESS.DISPLAY etc.
You will only see the vendor name and address for the first line for each vendor; the rest will have these fields blank. If Address is MV, however, the first line will take up multiple lines, so there will be some spacing between the first Purchase row and the second for that vendor, but each purchase after that would be single spaced. Using the break-on will make the report look better. It also looks nicer if you don't have MV fields, but it works in either case.
Use an @USER variable or part of one that you know isn't already being used in your application, or write an RBASIC program that saves the @USER variable, runs your RLIST, and sets the variable back when you're done.
Optionally, if you don't need to save the current values, you can run an RBASIC program just before running your RLIST that sets these @USER variables to null, just to make sure they're clear before you start. This usually isn't necessary, since the first record you process will set the variables anyway.
@USER1='
@USER1='
If there's a possibility that you will have multiple addresses for the same vendor name, change your sort to BY VENDOR.NAME BY VENDOR.ADDRESS because the ADDRESS.DISPLAY will show the address each time it's different from the last one that was displayed on the report.