Redwood Documentation

Product Documentation

 

›Agent Definition Types

RunMyJobsPlatform Agents

External Platforms

  • Connecting Redwood Server to External Platforms

Credentials

  • Storing Credentials
  • Credential Protocols

Platform Process Servers

  • On-site Platform Process Servers
  • Cloud Platform Agents
  • Using the Wizard to Create Process Servers
  • Configuring Platform Agents
  • Spool Host Agents
  • The Environment of Platform Agent OS Processes
  • Processing Platform Processes
  • Process Server Services
  • Configuring Agentless Process Servers
  • Automatically Updating Platform Agents
  • Enabling TLS
  • Creating Monitoring Checks
  • Configuring Load Balancing on Platform Agents
  • Platform Agent Registry Entries
  • Monitoring Servers with Platform Process Servers

UNIX Agents

  • UNIX Process Servers
  • UNIX Process Server Configuration Data
  • File Events on UNIX
  • Creating UNIX Process Servers (Advanced)
  • Choosing a User Switching Security Mode
  • Controlling Unix Platform Agents
  • Uninstalling Redwood Server Platform Agents from UNIX

Windows Agents

  • Creating a Microsoft Windows Process Server
  • File Events on Microsoft Windows Process Servers
  • Configuration of a Microsoft Windows Process Server
  • Managed Services
  • Configuring Platform Agents on Microsoft Windows
  • Automating Windows tasks that require a desktop window
  • Uninstalling Redwood Server from Microsoft Windows

Agent Definition Types

  • Using the BASH Definition Type
  • Using the KSH Definition Type
  • Using the CSH Definition Type
  • Using the Perl Definition Type
  • Using the Python Definition Type
  • Using the PowerShell Definition Type
  • Using the Visual Basic Script Definition Type
  • Using the CMD Definition Type
  • Using the R Process Definition Type
  • Using the DCL Definition Type
  • Using Platform Definition Types
  • Using the OS Native Definition Type
  • Microsoft Windows Definition Types
  • Using the SQLPLUS Definition Type
  • Using the FTP Definition Type
  • Using the Groovy Definition Type

Command Line Tools

  • Command Line System Tools
  • jtool
  • jcat
  • jdescription
  • jevent
  • jecho
  • jftp
  • JFTP Return Codes
  • jgetcredential
  • jgetfile
  • jgetpar
  • jjoin
  • jlink
  • jlog
  • jmail
  • jmessage
  • jmonitor
  • jputfile
  • jregister
  • jrfc
  • jscp
  • jtool screenshot
  • jscript
  • jsecret
  • jsleep
  • jsplit
  • api-tool.jar

OpenVMS Process Servers

  • Creating HP OpenVMS Process Servers
  • Installing the Platform Agent on HP OpenVMS
  • Configuring HP OpenVMS Process Servers
  • File Events on HP OpenVMS
  • HP OpenVMS Definition Types

AS/400 Connector

  • IBM AS/400 Connector Architecture
  • Setting up the IBM AS/400 Connector
  • Creating an IBM AS/400 Process Server
  • Files on AS/400 Raise Events
  • Using the AS/400 Definition Type
  • Redwood Server OS Support
  • IBM z/OS Definition Types
  • Using the JCL_FTP Definition Type
  • IBM z/OS System Tools

Reference

  • Balancing the Load
  • Credential Protocols
← Using the CMD Definition TypeUsing the DCL Definition Type →

Using the R Process Definition Type

The R language, an offshoot of S, is a statistical and graphics language with a long heritage. It is in widespread use around the world. It runs on all three major platforms - Microsoft Windows, Linux and macOS.

note

You must assign at least one process server to run R processes in order to use the process definition type.

Overriding the interpreter.

The standard interpreter used is that that you get by calling R. On Microsoft Windows, if the R binary is not on the path it will be located via the registry.

This should work fine on all platforms, but if it doesn't you can override it using the following:

  • JCS_INTERPRETER_R - parameter used to override default, can be set to value allowed by InterpreterWhitelist_R.
  • InterpreterWhitelist_R - process server parameter that takes a regex expression matching all interpreters you want supported. Use.* to allow any. On Microsoft Windows a common setting would be C:/Program Files/R/.*/R.exe to allow any version to be used.
  • LocalInterpreter_R - process server parameter used to set default.

Variables and Parameters

  • Parameters to the process definition are manipulated in the R source simply as if they are scalars or vectors, using the standard syntax. The customer script runs in a fresh environment so there is no clash with objects names used by the platform-agent runner.
  • The R language has knowledge of data-types. String, Character and Numeric parameters are translated to their equivalent R datatype.
  • Array parameters are supported and converted to vectors. Arrays must have unique elements.
note

Date, Time, DateTime and DateTimeZone (array) parameters are translated to POSIXlt parameters. As R cannot perform calculations on POSIXlt values that are not in its local timezone, any DateTimeZone values are all translated to the local timezone.

This means that you cannot transfer the time zone of a parameter to a R variable; it will be converted to the corresponding date-time in the local time zone of the host system. Out parameters will keep the timezone created for them.

Error Handling

If your script code exits with an error this is correctly reflected in the server, and output parameters are set as far as they were already set. Do note that the R process sets.Last and options(error) to accomplish this, so if you override these then output parameters will not be set if the process aborts with an error or quits without calling.Last.

Character set

On Microsoft Windows, the character set used for the script and the parameter transfer is the 'local' default character set of the Windows OS. This can be the standard 1252 codepage for most Windows systems, or any other codepage set as the default on the system.

On UNIX (for example Linux and macOS) the character set is the character set set for the network-processor. The default may be 'C' or some other setting that does not recognise every character required. On these systems we recommend setting the LANG environment variable to a UTF-8 character set, for example en_US.UTF-8.

Examples

Parameters

The following shows how to pass numeric (N1), string (S1) and date (D1) parameters to and from R scripts:

N1    = N1 + N1                             # Add number to itself
S1    = paste(S1, S1)                       # Concatenate string
D1    = D1 - as.difftime(30, units="days")  # Deduct 30 days from D1

# Create a new DateTimeZone output array with 2 different timezones
POUTDTZ = as.POSIXlt(character(0))
POUTDTZ[1] = as.POSIXlt("2023-09-28 01:00:00", tz="WET")
POUTDTZ[2] = as.POSIXlt("2111-11-11 01:00:00", tz="EET")

# Create a new Numeric output array with 7 elements (and one 'not available' value)
PNUMARR=c(1,2,3,4,5,NA,7)

# Create a new String output array with 6 elements (one of which is 'not available')
POUTSTR=c("You", "would", "like", NA, "to", "know")

Error Out

The following example shows you how to return a non-zero exit code resulting in the process going into Error:

quit(status = 5)

See Also

  • Platform Agent Process Definition Types
← Using the CMD Definition TypeUsing the DCL Definition Type →
  • Overriding the interpreter.
  • Variables and Parameters
  • Error Handling
  • Character set
  • Examples
  • Parameters
  • Error Out
  • See Also
Docs
Getting StartedInstallationFinance InstallationConcepts
TroubleshootingArchiving
Learn and Connect
Support Portal
BlogEventsResources
ISO/ IEC 27001 Information Security Management
Automate to be human

2023 All Rights Reserved |

Terms of Service | Policies | Cookies | Glossary | Third-party Software | Contact | Copyright | Impressum |