Using enhanced file names
Use macros to dynamically create unique file names in processing. A macro is resolved when a process is run. When specified, a macro remains in the request, so that a new name is generated each time the request is executed.
For example, when editing an extract request, type one or more macros in Extract File to generate a unique file name each time the extract request is run.
Specify a macro name as follows:
prefix< macro1[,literal1][,macro2][,literal2]...[,macroN][,literalN] >suffix
where:
- prefix
- A character prefix name (for example, ‘Extract').
- macro1-n
- A supported macro or a Windows environment variable name (for example, ‘$USER'). All macros after macro1 are optional.
- literal1-n
- An optional text string that is inserted in the file name, unchanged (for example, ‘workstation').
- suffix
- A character suffix name (for example, ‘.XF').
Rules and guidelines
When creating a file name macro, follow these rules and guidelines:
- The total length of the resolved file name cannot exceed 255 characters.
- Any characters (letters, numbers, spaces, or symbols) that are valid for a file name are permitted for the prefix and suffix.
- Macros and literals can be separated by spaces or commas.
- All macros in a file name must be enclosed in a single set of angle brackets (i.e., < $MM $DD $YY >)
- A file name can include a supplied macro or a Windows environment variable. All supplied macros begin with a $ symbol (as in $USER), and all Windows environment variables must be enclosed in % symbols (as in %NETUSER%).
- Macro names are not case sensitive.
- The number of macros and literals permitted is limited only by the length of the resulting file name.
- Only the prefix and suffix are validated at the time a process request is edited. When the request is executed, the name is generated and validated. If the resulting file name is invalid, the process fails.
Optim macros
Use these supplied macros to generate unique file names.
- $D or $DW
- The numeric day of the week in which the file is created, for example, 1 = Sunday, 2 = Monday.
- $DAY
- The name of the weekday in which the file is created, for example, Sunday and Saturday.
- $DD
- The 2-digit day of the month in which the file is created, for example 01 and 31.
- $DE
- The European numeric day of the week in which the file is created, for example, 1 = Monday, 2 = Tuesday.
- $DY or $DDD
- The two or three digit day of the year in which the file is created, for example, 01 and 366.
- $HH
- The 2-digit hour in which the file is created, for example, 00 and 23.
- $HHMM
- The hour and minute in which the file is created, for example, 0000 and 2359.
- $MIN
- The 2-digit minute in which the file is created, for example, 00 and 59.
- $MM
- The 2-digit month in which the file is created, for example, 01 and 12.
- $MON
- The 3-character abbreviation for the month in which the file is created, for example, Jan and Dec.
- $OBJNAME
- The name of the table or view processed in a conversion to CSV, XML or ECM format.
- $SEQn
- A number from 0 through 2,147,483,647 that is incremented by a single digit each time the macro generates a number. Optionally use n to limit the number to n places, including leading zeros. For example, the macro EXTRACT<$MON $YYYY SEQ $SEQ4>.XF might generate a file name of C:\ProgramFiles\Softech\RT\DATA\EXTRACTNov2000SEQ0010.XF.
- $SS
- The second in which the file is created, for example, 00 and 59.
- $USER
- The user account for the operating system.
- $WE
- The numeric week of the year (00 through 52) in which the file is created, with Monday as the first day of the week.
- $WW
- The numeric week of the year (00 through 52) in which the file is created, with Sunday as the first day of the week.
- $YY
- The 2-digit year in which the file is created, for example, 00 and 99.