1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

A program that outputs a report, as a CSV

Discussão em 'StackOverflow' iniciado por fdantas, Novembro 21, 2018.

  1. fdantas

    fdantas Administrator Moderador

    Ho do I write code for a program that can accept three input parameters: x , y, and the filename to write to?

    I should be able to call the program like this: run prog.p (input “1”, input 5, input “filename1.csv”).

    so far my I have written the code below and not sure how to go around it.

    OUTPUT TO xxxxxx\filename1.csv".

    DEFINE VARIABLE Profit AS DECIMAL FORMAT "->>,>>9.99":U INITIAL 0 NO-UNDO.

    EXPORT DELIMITER "," "Amount" "Customer Number" "Invoice Date" "Invoice Number" "Total_Paid" "Profit".

    FOR EACH Invoice WHERE Invoice.Ship-charge > 5.00
    AND Invoice.Total-Paid > 0.01
    AND Invoice.Invoice-Date GE 01/31/93 /* this is between also can use < >*/
    AND Invoice.Invoice-Date LE TODAY NO-LOCK:

    Profit = (Invoice.Invoice-Num / Invoice.Total-Paid) * 100.

    EXPORT DELIMITER "," Amount Cust-Num Invoice-Date Invoice-Num Total-Paid Profit.
    END.

    OUTPUT CLOSE.


    Thank you.

    Continue reading...

Compartilhe esta Página