OS-Command not working

Pavan Yadav

Member
Hi,
Anybody can help me out that where i am wrong & wht's wrong with the code.

Code:
DEFINE STREAM s-out.
DEFINE STREAM s-out1.
DEFINE STREAM s-in.

OUTPUT STREAM s-out TO "C:\Sports\Out-cust.csv".    
OUTPUT STREAM s-out1 TO "C:\Sports\Out-cust1.csv".  
        
FOR EACH customer NO-LOCK :
    IF Customer.CreditLimit >= 15000 THEN
    EXPORT STREAM s-out DELIMITER ","
        Customer.
    ELSE
        EXPORT STREAM s-out1 DELIMITER ','
            Customer.
END.


OS-APPEND VALUE("C:\Sports\Out-cust1.csv") VALUE("C:\Sports\Out-cust.csv").
OS-DELETE VALUE("C:\Sports\Out-cust1.csv").
OS-RENAME VALUE("C:\Sports\Out-cust.csv") VALUE("C:\Sports\Customer.csv").


Now problem is:: Append, Delete, & Rename is not working. So, please help me out in the same.
Thanks...
 

RealHeavyDude

Well-Known Member
I don't see that you close the output streams in your program code.

An output stream remains open until you explicitly close it or the program which defined the stream goes out of scope.

OUTPUT STREAM xxx CLOSE.



Regards, RealHeavyDude.
 
Top