IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  deleting a file

    Posted 10/02/08 12:53 PM

    Originally posted by: raj1


    I have a situation where on some condition is satisfied then i have to delete the file which is at a given location. I tried with get("delete",location,data)but i couldnot resolve the problem.Can anybody help me how to do this
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: deleting a file

    Posted 10/03/08 04:30 AM

    Originally posted by: paul.brett


    Try using a RUN() function with an -IF1X override.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: deleting a file

    Posted 10/03/08 03:00 PM

    Originally posted by: john.gibby


    
    =IF( LEFT(GETFILENAME(FileObject),1)=
    "/" ,GET(
    "SHL",
    "-cli -cmd 'rm " + GETFILENAME(FileObject) + 
    " '") 
    // UNIX ,GET(
    "BAT",
    "-cli -cmd 'del " + GETFILENAME(FileObject) + 
    " '") 
    // WINDOWS )
    


    good luck,
    John
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: deleting a file

    Posted 10/03/08 03:50 PM

    Originally posted by: LaurentB


    Instead of IF(LEFT(GETFILENAME())="/".., I'm now using IF ("<NL>"="<LF>", ... (I did not think about it myself, but saw it in a colleague's map)...

    Be careful if you go with the shell adapter, it may create memory issues when running multiple maps in parallel
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 5.  Re: deleting a file

    Posted 10/06/08 11:05 AM

    Originally posted by: raj1


    Thanks for the valuable information.But i am getting a strange issue.
    I used the get("bat","-cli -cmd 'del <path>/filename'"). But it is not getting deleted.If i keep the file in any other path,then it is getting deleted.I created a subfolder under the existing folder and kept the file there.Then also it is getting deleted.Why it is happening?Do you have any clue?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 6.  Re: deleting a file

    Posted 10/07/08 03:38 AM

    Originally posted by: janhess


    Does the path have any spaces in it?
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: deleting a file

    Posted 10/14/08 10:43 AM

    Originally posted by: john.gibby


    If the file is one of the input files for the map you are in, you will not be able to delete it as the map has a lock on it. You can set the file adapter to delete it when the map is finished and that should accomplish what you are trying to do.

    John
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender