IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

zip adapter

  • 1.  zip adapter

    Posted 10/22/07 03:10 PM

    Originally posted by: SystemAdmin


    Hi,
    I am trying to use the zip adapter command to zip a few files.
    the command i used in the o/p map rule is:

    =put("ZIP","FILE,\\xyz.zip,\\abc.txt" ," ")
    where \\xyz.zip is the complete path of the zipped file which i want
    and \\abc.txt is the complete path of my file which i want to be zipped.

    though the map says completed successfully, it dosent zip the files.
    any suggestions what cud be wrong here ....
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: zip adapter

    Posted 10/23/07 04:08 AM

    Originally posted by: janhess


    What OS are you running on? If windows try omitting the \\.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: zip adapter

    Posted 10/23/07 09:44 AM

    Originally posted by: SystemAdmin


    iam running it on Windows...
    and in fact iam not using \\

    iam copying the rule that Iam using...

    =PUT
    ("file","complete file path of the o/p zip file.zip",
    "complete file path of the i/p file to be zipped.txt")
    and my o/p adapter card has the following command

    target-archive(zip)
    command--OAZIP1

    thanks & regards
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: zip adapter

    Posted 10/23/07 09:51 AM

    Originally posted by: janhess


    Your output card adapter should be SINK and you should use VALID/FAIL functions as Rep said to show the error.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 5.  Re: zip adapter

    Posted 10/23/07 09:53 AM

    Originally posted by: SPG


    The file that you want to zip, are you creating that within the same map ?
    SPG
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: zip adapter

    Posted 10/23/07 09:53 AM

    Originally posted by: janhess


    Did you miss the ZIP adapter out of your PUT? If not then you are doing it all wrong. Your original post is how it should be.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: zip adapter

    Posted 10/23/07 10:09 AM

    Originally posted by: SystemAdmin


    Jan , looking into some of ur earlier posts in this thread i am using the following rule:

    =VALID(
    put("ZIP","FILE, complete file path of the zipped file.zip,complete file path of the i/p file.txt" ," "),
    FAIL("error" + LASTERRORCODE() + ": " + LASTERRORMSG()))

    also my o/p adapter is sink now....

    iam now gettting the error as Fail func aborted the map

    SPG,
    The file iam trying to zip is not the one created by the map....


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


  • 8.  Re: zip adapter

    Posted 10/23/07 10:12 AM

    Originally posted by: janhess


    What's the error code and message? It should be in your log file.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: zip adapter

    Posted 10/23/07 10:13 AM

    Originally posted by: SPG


    Can you post the error code and error message you are getting ?
    Also, is it possible to see the "rule", exactly as you have typed in the designer....

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


  • 10.  Re: zip adapter

    Posted 10/23/07 10:33 AM

    Originally posted by: SystemAdmin


    when iam using the file option the error code and message are as follows:
    <ExecutionSummary MapStatus="Error" mapreturn="30" ElapsedSec="0.0103" BurstRestartCount="0">
    <Message>FAIL function aborted map:error-12: Nothing to do!</Message>
    when iam usin g the Memory option i get the error code & message as:
    <ExecutionSummary MapStatus="Error" mapreturn="30" ElapsedSec="0.0095" BurstRestartCount="0">
    <Message>FAIL function aborted map:error-16: Invalid combination of control parameters</Message>

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


  • 11.  Re: zip adapter

    Posted 10/23/07 10:39 AM

    Originally posted by: janhess


    Error 12 is file doesn't exist.

    I have a job that zips all the files in a folder with a .bak extension. The output card uses the Archive(zip) adapter and the command is FILE,\\servername\clasmaps65\logs\LogArchive.zip,*.bak
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 12.  Re: zip adapter

    Posted 10/23/07 10:43 AM

    Originally posted by: SPG


    If you use MEMORY option, then the third argument of the PUT function should have the data you are trying to put in the zip file. I hope you took care of that.
    If there are no security issues can we see the exact rule ?

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


  • 13.  Re: zip adapter

    Posted 10/23/07 10:51 AM

    Originally posted by: SystemAdmin


    Jan/SPG,
    could anybody of u kindly upload a example of zip if u have it readily avlb...
    appreciate ur help in this regard
    thanks in advance....
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 14.  Re: zip adapter

    Posted 10/23/07 11:19 AM
      |   view attached

    Originally posted by: SystemAdmin


    Hi Jan/SPG,
    i am posting a sample scenario of the task...
    Regards
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)



  • 15.  Re: zip adapter

    Posted 10/23/07 11:35 AM

    Originally posted by: janhess


    I unziped everything to c:\temp. It created a folter c:\temp\zip. I changed the rule to
    =VALID(put("ZIP","FILE, C:\temp\zip\test.zip,C:\temp\zip\xyz.txt" ," "),
    FAIL("error" + LASTERRORCODE() + ": " + LASTERRORMSG()))
    and it worked ok. There must be something wrong with your path.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 16.  Re: zip adapter

    Posted 10/23/07 11:52 AM

    Originally posted by: SystemAdmin


    Jan, u r rite....when i put the i/p file (to be zipped) in C:\TEMP\zip & run the map, i get the zipped file test.zip....

    but when i did use the same rule & copied the i/p file to a folder on desktop
    (C:\Documents and Settings\ask\Desktop\zip) it dosent generate the zipped file and says "Fail func aborted Map"
    with the log text as below:
    <ExecutionSummary MapStatus="Error" mapreturn="30" ElapsedSec="0.0104" BurstRestartCount="0">
    <Message>FAIL function aborted map:error-12: Nothing to do!</Message>
    <CommandLine>'C:\Documents and Settings\anup kamble\Desktop\zip\phone.mmc'</CommandLine>

    Iam still guessing for this strange result....

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


  • 17.  Re: zip adapter

    Posted 10/23/07 12:02 PM

    Originally posted by: janhess


    I tried the original rule creating the correct file path and that worked ok under XP

    VALID( PUT( "ZIP",
    "FILE,C:\Documents and Settings\anup kamble\Desktop\zip\test.zip,C:\Documents and Settings\anup kamble\Desktop\zip\xyz.txt" ,
    " "),
    FAIL("error" + LASTERRORCODE() + ": " + LASTERRORMSG()))
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 18.  Re: zip adapter

    Posted 10/23/07 12:10 PM

    Originally posted by: SPG


    Documentation says "Enclose long filenames in double quotes ("longfilename"). "
    I think your filepath has spaces.

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


  • 19.  Re: zip adapter

    Posted 10/23/07 11:46 AM
      |   view attached

    Originally posted by: SPG


    I made some changes and then it worked for me too.
    Attached is the updated code. For some reason I could not use the type tree you sent, so I used one of mine.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender

    Attachment(s)



  • 20.  Re: zip adapter

    Posted 10/23/07 11:50 AM

    Originally posted by: janhess


    I didn't send a type tree. You changed the path to your data file and zip file so presumably the original path was incorrect.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 21.  Re: zip adapter

    Posted 10/23/07 12:28 PM

    Originally posted by: SystemAdmin


    Jan/SPG,
    thanks for ur all ur help on this.....

    i did post another query on this forum couple of days back titled:
    "triggering a map on d/b DML operation"...

    i havent received a single reply untill now....could u throw some light on that aspect if possible?

    when i type trigger scripts in WTX 8.1 help i get the below text:
    Database triggers using Oracle

    When using Oracle, the triggering installation scripts must be installed and run by your system administrator. For more information about these scripts, see the chapter on database triggers in the Database Interface Designer documentation.

    have u worked on anything like these.....

    once again Jan/SPG thanks for all ur efforts....
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 22.  Re: zip adapter

    Posted 10/23/07 03:37 PM

    Originally posted by: SystemAdmin


    also wats the command for unziping the zipped files?
    the help just says:

    GET

    Source

    archive(zip)

    command

    file_name.zip,file_name.txt
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 23.  Re: zip adapter

    Posted 10/24/07 10:06 AM

    Originally posted by: janhess


    You have to specify the zip file name and the name of the file you want to extract.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 24.  Re: zip adapter

    Posted 10/24/07 11:03 AM

    Originally posted by: SystemAdmin


    i did the following changes to unzip the zipped files...
    i/p card:
    Get-Source- archive(zip)
    & command as xyz.txt,test

    where test is the archive file name &
    xyz.txt is the name of the file which needs to be restored from archive...
    o/p card:
    sink

    but i get a error as source not avlb

    i tried giving complete file paths with .zip extension as well.but does not help
    any suggestions...

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


  • 25.  Re: zip adapter

    Posted 10/24/07 11:23 AM

    Originally posted by: janhess


    Like I said above - zip file name, file(s) to extract)
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 26.  Re: zip adapter, Maybe I'm reading this wrong

    Posted 10/24/07 01:30 PM

    Originally posted by: SystemAdmin


    Maybe I'm reading this wrong ASK, and forgive me if I am, but..

    By your second post, you said:
    =PUT
    ("file","complete file path of the o/p zip file.zip",
    "complete file path of the i/p file to be zipped.txt")
    and my o/p adapter card has the following command

    target-archive(zip)
    command--OAZIP1

    First, if you set an output card to "Archive(zip)", you don't do a PUT. You supply the adapter commands in the actual Card, and the commands would look like:

    FILE, "c:\temp\myzip.zip", inputfiletozip.txt
    Now any data you pass to that card, like it there were one rule with a text field and you put ="zip this up", will get zipped using the output card command settings.

    Now, if you're doing a PUT, you're output card should not be set to zip; it should be sink, or file. And in the PUT, you're giving it all the commands you would do in the output card and rather then zip up the data you pass the output card like above, you're telling it what data to put in the file that get's zipped up, using the Pacakage function).

    =PUT("zip", "FILE",'c:\temp\myzip.zip',"inputfiletozip.txt", PACAKAGE(The data in inputfiletozip.txt"))

    You can package the input card's data, another output cards data, etc.

    Finally, if you're overriding the output card in a run map, then you use -OAZIP1. Let's say the output card hard coded in the map is a file. When you do the run map, you do:

    =RUN("mymap.mmc", " -OAZIP1 'FILE,c:\temp\myzip.zip, inputfiletozip.txt' )
    and override the output card putting in the zip adapter commands.

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


  • 27.  I meant PACKAGE, not PACAKAGE

    Posted 10/24/07 01:32 PM


  • 28.  Re: I meant PACKAGE, not PACAKAGE

    Posted 10/24/07 01:43 PM

    Originally posted by: SystemAdmin


    thanks rep, thats resolved.
    I was now doing the other way round for unzipping the files.....

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


  • 29.  Re: unzipping...

    Posted 10/24/07 02:25 PM

    Originally posted by: SystemAdmin


    Well, from what I recall and it's been a while....

    You're better off getting a list of the files in the zip, then unzipping them one at a time. I can't remember if you can use wildcards and unzip them all at once, but I could have sworn my last boss had a system that got all the names out of the zip, then he unzipped them one at a time.
    kind of busy, so good luck.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 30.  Re: zip adapter

    Posted 10/23/07 09:56 AM

    Originally posted by: SPG


    Also, did you try the MEMORY option instead of FILE ?

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


  • 31.  Re: zip adapter

    Posted 10/23/07 09:07 AM

    Originally posted by: SystemAdmin


    Well, first, if the PUT statement did fail, you probably wouldn't know without the VALID/FAIL functions.

    Other then than that, it's probably a syntax problem on the path.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender