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.  Zip

    Posted 08/18/04 01:09 AM

    Originally posted by: SystemAdmin


    Hi
    I am trying to write a map that takes all files from a folder, zips them and places them in a different folder.
    Yes, that sounds like a pretty straight forward map.
    When I give the input card an absolute path to a file it works and zips, but when I use a wildcard character to get everything in the folder - like E:\testfolder\* I get a source not availble. I have also tried with ? as the wildcard character.
    I run the map with the eventserver.
    Maybe the input type tree is just wrong.
    I have a group with an item(s) in it.

    Any ideas.

    Thanks.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Zip

    Posted 08/18/04 01:39 AM

    Originally posted by: SystemAdmin


    I use

    FILE,\\sv_nt_gos101\mercatormaps67\logs\LogArchive.zip,*.bak

    for the zip adapter ok in 6.5.1 & 6.7.1 under the event server.
    You don't need to read the files in an input card. You just need something to trigger the map - time event or file event?
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 3.  Re: Zip

    Posted 08/18/04 04:22 AM

    Originally posted by: SystemAdmin


    Hi Janhess
    Thanks for your reply.
    I deleted the inputcard and the rule on the outputcard now looks like this.
    =VALID(
    PUT("ZIP","FILE,test.zip","\files\*txt"),
    FAIL(LASTERRORCODE() + ": " + LASTERRORMSG()))

    I get an :
    -1: Invalid command line: missing zip file name after 'file' keyword.
    I must be doing it the wrong way since it does not recognize my file name?

    I must admit that I do not know the difference between using
    "memory" and "file" with the zip adapter. I did use Memory but
    now tried I with FILE.

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


  • 4.  Re: Zip

    Posted 08/18/04 04:39 AM

    Originally posted by: SystemAdmin


    Alex,
    Try this

    =VALID(
    PUT("ZIP","FILE","test.zip","\files\*txt"),
    FAIL(LASTERRORCODE() + ": " + LASTERRORMSG()))

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


  • 5.  Re: Zip

    Posted 08/18/04 06:16 AM

    Originally posted by: SystemAdmin


    hmm it looks like the rule is invalid.
    It complains about a missing bracket ")" .
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 6.  Re: Zip

    Posted 08/18/04 06:46 AM

    Originally posted by: SystemAdmin


    You're right. I should have tested it. This is what I used for zipping a specific file using a run map with 1 output card.
    valid(run("ZipFiles","-OAZIP1 FILE,WORKFILES\" + WORD(REVERSEBYTE(word(REVERSEBYTE(getfilename(infile)),"\",1)),".",1) + ".zip," + getfilename(infile)),fail("zip file failed " + TEXT ( LASTERRORCODE ( ) ) + " " + LASTERRORMSG))

    It would probably work with a wild card.

    PUT version is
    =VALID(
    put("ZIP","FILE, test.zip,c:\temp\*.txt" ," "),
    FAIL("error" + LASTERRORCODE() + ": " + LASTERRORMSG()))
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 7.  Re: Zip

    Posted 08/18/04 11:52 PM

    Originally posted by: SystemAdmin


    Hello Jan

    Thank you very much for your help.
    That worked.

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


  • 8.  Re: Zip

    Posted 08/20/04 12:05 AM

    Originally posted by: SystemAdmin


    Hi
    What would be the best way to delete the files from the source directory
    after the files have been zipped?

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


  • 9.  Re: Zip

    Posted 08/20/04 12:36 AM

    Originally posted by: SystemAdmin


    I just run a batch process to delete the files from the last card in the map.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 10.  Re: Zip

    Posted 08/20/04 01:22 AM

    Originally posted by: SystemAdmin


    Hi ,

    I think the better way is to run a map per file to delete.
    That means call a delete map (1:1 endless text to endeless text) with input overwrite -IF1X .
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 11.  Re: Zip

    Posted 08/20/04 01:40 AM

    Originally posted by: SystemAdmin


    "Posted: Fri Aug 20, 2004 9:22 am Post subject: Re: Zip

    quote:9ca7e8a26aI think the better way is to run a map per file to delete. [/quote:9ca7e8a26a]

    The zip is using wildcards. The map doesn't read in any files so the file names aren't known. Therefore use batch process to delete files with same wildcard.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender