LogoLogo
3.5.7
3.5.7
  • Introduction
  • Getting started
    • Installation
      • On-premises
        • Single-node
        • Multi-node
      • Azure Market Place
      • AWS Market Place
    • Tutorials
      • Amazon AWS CUR
      • Amazon AWS CUR (Athena)
      • Azure Stack
      • Azure EA
      • Azure CSP
      • Google Cloud
      • VMware vCloud
      • VMware vCenter
    • Concepts
      • User interface
      • Services
    • Releases
      • Upgrading to version 3
      • Known issues
      • Announcements
      • Archive
  • Reports
    • Accounts
    • Services
    • Instances
    • Summary
    • Budget
  • Services
    • Manage
    • Rates
    • Adjustments
    • Subscriptions
  • ACCOUNTS
    • Budget management
  • Data pipelines
    • Extract
      • Configuration
      • Templates
      • Script basics
      • Parslets
      • Subroutines
        • check_dateformat
        • check_dateargument
        • format_date
        • validate_response
      • Language
        • aws_sign_string
        • basename
        • buffer
        • csv
        • clear
        • discard
        • encode
        • encrypt
        • environment
        • escape
        • exit_loop
        • foreach
        • generate_jwt
        • get_last_day_of
        • gosub
        • gunzip
        • hash
        • http
        • if
        • json
        • loglevel
        • loop
        • match
        • pause
        • print
        • return
        • save
        • set
        • subroutine
        • terminate
        • unzip
        • uri
        • var
    • Transform
      • Transform Preview
      • Configuration
      • Language
        • aggregate
        • append
        • calculate
        • capitalise
        • convert
        • copy
        • correlate
        • create
        • default
        • delete
        • environment
        • event_to_usage
        • export
        • finish
        • if
        • import
        • include
        • lowercase
        • normalise
        • option
        • rename
        • replace
        • round
        • services
        • set
        • split
        • terminate
        • timecolumns
        • timerender
        • timestamp
        • update_service
        • uppercase
        • var
        • where
    • Datasets
    • Lookups
    • Metadata
    • Reports
    • Workflows
  • Administration
    • User management
      • SAML2/LDAP
      • Users
      • Groups
    • Notifications
    • Settings
      • Global Variables
  • Advanced
    • Integrate
      • GUI automation
        • Examples
      • API docs
      • Single sign-on
        • Azure-AD
        • Auth0
        • OneLogin
        • ADFS
        • LDAP
    • Security
    • Digging deeper
      • Authentication flows
      • Transformer datadate
      • Dataset lifecycle
      • Config.json
      • Directories
      • Databases
  • Terms & Conditions
  • Privacy Policy
Powered by GitBook
On this page
  • Syntax
  • Details
  • Example

Was this helpful?

Export as PDF
  1. Data pipelines
  2. Extract
  3. Language

return

PreviousprintNextsave

Last updated 5 years ago

Was this helpful?

The return statement is used to exit a subroutine at an arbitrary point and return to the calling location

Syntax

return

Details

A will automatically return to the location it was called from when the end of its body is reached. However it may be desirable to explicitly exit the subroutine at some other point in which case the return statement is used.

The return statement cannot be used to return a value to the calling code (this should be done via the use of variables as described in the statement documentation)

Example

#
# Download two files into named buffers
# using a subroutine to do so
#
gosub getfile(data1, "http://intranet/datadump1.json")
gosub getfile(data2, "http://someotherserver/anotherfile.xml")

# (Script to do something with the data goes here)

#
# Argument 1: the name of the buffer to store the data
# Argument 2: the URL of the file to download
#
subroutine getfile {
    if (${SUBARG.COUNT} != 2) {
        print "Error: This subroutine requires two arguments
        return
    } 

    buffer ${SUBARG_1} = http GET "${SUBARG_2}"
    # There is an implicit 'return' here
}
subroutine
subroutine