File Format Macro Examples file-format-macro-examples

Examples of how macros are used to create outbound, FTP file templates.

NOTE
In the tables, boldface type identifies each macro with its related output. For the format examples, the < > symbols have been added to help visually separate each macro.

Common Macros common-macros

These macros can be used in any format field. See the File Format Macros for a complete list and definitions.

Macro
Format and Output Examples
DPID

Format: <SYNC_TYPE>_<ORDER_ID>_ <DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_215_ 888_iter_1449756724.sync

MASTER_DPID

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_ <MASTER_DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_215_888_ 20915_iter_1449756724.sync

ORDER_ID

Format: <SYNC_TYPE>_ <ORDER_ID>_<DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output: ftp_ 215_888_iter_1449756724.sync

SYNC_MODE

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_ <SYNC_MODE>_<TIMESTAMP>.sync

Output:

  • Full: ftp_215_888_ full_1449756724.sync
  • Incremental: ftp_215_888_ iter_1449756724.sync
SYNC_TYPE

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_<SYNC_MODE>_<TIMESTAMP>.sync

Output:

  • FTP: ftp_215_888_iter_1449756724.sync
  • https: http_215_888_iter_1449756724.sync
  • S3: s3_215_888_iter_1449756724.sync
TIMESTAMP

Format: <SYNC_TYPE>_<ORDER_ID>_<DPID>_<SYNC_MODE>_ <TIMESTAMP>.sync

Output: ftp_215_888_iter_ 1449756724.sync

Header Field Macros header-field-macros

Macros used in header fields only. See the File Format Macros for a complete list and definitions.

Macro
Format and Output Examples
TAB

Format: <ORDER_ID> <TAB><SYNC_TYPE>

Output: 888 full.sync

In the output, the non-printing tab character separates each element.

Data Row Macros data-row-macros

Macros used in header fields only. See the File Format Macros for a complete list and definitions.

Macro
Format and Output Examples
DP_UUID

Format: <DP_UUID><TAB><DP_UUID_LIST;separator=TAB>

Output: 123456 UUID1 UUID2 UUID3

DP_UUID_LIST

Format: <DP_UUID><TAB> <DP_UUID_LIST;separator=TAB>

Output: 123456 UUID1 UUID2 UUID3

SEGMENT_LIST && REMOVED_SEGMENT_LIST

This example creates a format that returns removed segments in a server-to-server feed.

{"AdvertiserId":"<PIDALIAS>", "DataCenterId": 2,"TDID":"<DP_UUID>", "Data":[<SEGMENT_LIST:{seg|<OPEN_CURLY_BRACKET>"Name":"<seg.alias>"<CLOSE_CURLY_BRACKET>}; separator=","><if(SEGMENT_LIST && REMOVED_SEGMENT_LIST)><COMMA><endif> <REMOVED_SEGMENT_LIST:{seg|<OPEN_CURLY_BRACKET>"Name":"<seg.alias>", "TtlInMinutes":0<CLOSE_CURLY_BRACKET>}; separator=",">]}

SEGMENT_LIST

Format: <DP_UUID> <SEGMENT_LIST>;separator=" ">

Output: 123456 105955 101183 101180 101179

SET_ATTRIBUTES

Format: <PID><TAB><UUID><TAB><DP_UUID><TAB> <SET_ATTRIBUTES><TAB><OPT_OUT><TAB><SEGMENT_LIST:{seg|<seg.type>,<seg.alias>,<OUTPUT_ATTRIBUTE_VALUE>,<seg.lastUpdateTime>&}>

Output: 1159 00088008579683653741516297509717335000 17t0aj01b120hp 1 0 5,103714,1,1344114661000&5,103713,1,1343250661000

TAB

Format: <DP_UUID><TAB><DP_UUID_LIST;separator=TAB>

Output: 123456 UUID1 UUID2 UUID3

In the output, the non-printing tab character separates each element.

TRAIT_LIST

Format: <PID><TAB><DP_UUID><TAB><SET_ATTRIBUTES><TAB> <TRAIT_LIST;separator=“|”>

Output: 1131 12345 1 123|456|789

recommendation-more-help
3d9f8cff-f6d8-4dcd-966c-cf2ea03db934