PUT

The PUT function passes data to a target adapter.

Use PUT to route data within your map using one of the target adapters such as to a messaging system, a database, a file, and so forth.

When the PUT function is used in a map, the default OnSuccess action is adapter specific. The default OnFailure action is to rollback any changes made during map processing. The default Scope will be integral unless the map is defined to run in bursts (which is the case when one or more inputs have the FetchAs property set to Burst).

Syntax:
PUT (single-text-expression , single-text-expression , single-text-expression)
Meaning:
PUT (adapter_alias , adapter_commands , data_to_send_to_adapter)
Returns:
"None"

The adapter identified by adapter_alias is called using the specified adapter_commands and passing data_to_send_to_adapter as data to the adapter.

The PUT function is not processed if the third argument is zero-sized data or NONE.

To identify whether the function was successful, you can generally use the VALID function with the PUT function. However, for certain adapters such as E-mail and FTP, the success state is not known until after map completion and using the VALID function in such cases might consistently return "success".

Examples

This example illustrates a mapping situation in which a set of messages is being produced in the output (output card #1). However, the ultimate target for these messages is a message queue and the messages need to be placed on the queue one at a time.

To accomplish this, the first output card builds the set of messages and its Target is defined as Sink. So, this set of messages is constructed in memory, but is discarded after the map completes. A second output card, uses the following PUT function to put each output message (from output card# 1), individually, on the output queue.

Message(s) = PUT ("MQS", "-QMN myqueuemgr -QN chips_queue -T", PACKAGE (PaymentMessage:CHIPS_Payment_Message))

  • The first argument, MQS, identifies that the data is to be routed using the IBM WebSphere MQ (server) adapter.
  • The second argument, "-QMN myqueuemgr -QN chips_queue -T", provides the adapter commands needed by the adapter to put the message on the queue.
  • The third argument, PACKAGE, passes the data that is to be sent as the body of the message.

Related functions

  • FAIL
  • GET
  • LASTERRORCODE
  • LASTERRORMSG
  • VALID