7) built-in functions · tso/e external functions mvsvar mvsvar returns information about mvs,...

100
Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies. This course has been prepared by Milos Forman for MCoE needs only! 7) Built-in functions • Built-in Function overview, • Non SSA Built-in Functions • TSO External Functions. . Resources: TSO/E REXX Reference TSO/E REXX User’s Guide

Upload: others

Post on 26-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

This course has been prepared by Milos Forman for MCoE needs only!

7) Built-in functions

• Built-in Function overview,• Non SSA Built-in Functions • TSO External Functions..

Resources: TSO/E REXX Reference

TSO/E REXX User’s Guide

Page 2: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

PROPRIETARY AND CONFIDENTIAL INFORMATION

TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION "ASIS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIEDWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ORNONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRDPARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THISDOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESSINTERRUPTION, GOODWILL OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCHLOSS OR DAMAGE.THE USE OF ANY PRODUCT REFERENCED IN THIS DOCUMENTATION AND THISDOCUMENTATION IS GOVERNED BY THE END USER’S APPLICABLE LICENSE AGREEMENT.The manufacturer of this documentation is CA, Inc.Provided with "Restricted Rights" as set forth in 48 C.F.R. Section 12.212, 48 C.F.R. Sections52.227-19(c)(1) and (2) or DFARS Section 252.227.7013(c)(1)(ii) or applicable successorprovisions.

RESTRICTED RIGHTS LEGEND

These education materials and related computer software program (hereinafter referred to asthe "Education Materials") is for the end user’s informational purposes only and is subject tochange or withdrawal by CA, Inc. at any time.These Education Materials may not be copied, transferred, reproduced, disclosed ordistributed, in whole or in part, without the prior written consent of CA. These EducationMaterials are proprietary information and a trade secret of CA. Title to these EducationMaterials remains with CA, and these Education Materials are protected by the copyright lawsof the United States and international treaties. All authorized reproductions must be markedwith this legend.

Page 3: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

This course has been prepared by Milos Forman for MCoE needs only!

What is a function?

• A pre-written subroutine.

• A function returns a value.

• The function name is suffixed with brackets, which are used for any arguments.

• REXX has a number of supplied functions.

Page 4: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

Page 5: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

Page 6: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

Page 7: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

POS(), LASTPOS()

returns the position of the last occurrence of one string, needle, in another,haystack.

Page 8: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

POS(), LASTPOS() examples

Page 9: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LEFT(), RIGHT()

Page 10: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LEFT(), RIGHT() examples

Page 11: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

Page 12: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

Page 13: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

Page 14: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SUBSTR()

Page 15: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

ABBREV()

Page 16: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TRANSLATE()

Page 17: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TRANSLATE()

Page 18: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DELSTR()

Page 19: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

INSERT()

Page 20: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

OVERLAY()

Page 21: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

CENTRE()

Page 22: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SPACE()

Page 23: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SPACE()

Page 24: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

FORMAT()

Page 25: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

FORMAT()

Page 26: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

COMPARE(), COPIES()

Page 27: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LENGTH(), REVERSE()

Page 28: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DELWORD()

Page 29: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SUBWORD(), WORD()

Page 30: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

WORDINDEX(), WORDLENGTH()

Page 31: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

WORDS()

Page 32: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Arithmetic Functions

Page 33: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 34: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 35: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 36: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 37: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

Page 38: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

Page 39: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

Page 40: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functions

In addition to the built-in functions, TSO/E provides external functions that you can use to do specific tasks:

GETMSG - returns in variables a system message issued during an extended console session. It also returns in variables associated information about the message.

LISTDSI - returns in variables the data set attributes of a specified data set.

MSG - controls the display of TSO/E messages. The function returns the previous setting of MSG (ON/OFF).

MVSVAR - uses specific argument values to return information about MVS, TSO/E, and the current session.

OUTTRAP - traps lines of TSO/E command output into a specified series of variables. The function call returns the variable name specified.

Page 41: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functions

PROMPT - sets the prompt option ON/OFF for TSO/E interactive commands. The function returns the previous setting of prompt.

SETLANG - retrieves and optionally changes the language in which REXX messages are displayed. The function returns the previous language setting.

STORAGE - retrieves and optionally changes the value in a storage address. Carefully!

SYSCPUS - returns in a stem variable information about all CPUs that are on-line.

SYSDSN - returns OK if the specified data set exists; otherwise, it returns an appropriate error message.

SYSVAR - uses specific argument values to return information about the user, terminal, language, exec, system, and console session.

Page 42: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsLISTDSI

You can use the LISTDSI (List Dataset Information) function to retrieve detailed information about a data set’s attributes.

LISTDSI does not support tape datasets. LISTDSI supports GDG data sets when using absolute generation names, but does not support relative GDG names. LISTDSI does not support HFS data sets.

Page 43: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsMVSVAR

MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the security label of the TSO/E session.

The MVSVAR function is available in any MVS address space.

Page 44: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSCPUS

SYSCPUS places, in a stem variable, information about those CPUs that are on-line.

The SYSCPUS function runs in any MVS address space.

Page 45: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSDSN

SYSDSN returns whether the specified data set exists and is available for use. The dsname can be the name of any cataloged data set or cataloged PDS with a member name. Additionally, if you specify a member of a PDS, SYSDSN checks to see if you have access to the data set.

SYSDSN does not support tape datasets. SYSDSN supports generation data group (GDG) data sets when using absolute generation names, but does not support relative GDG names.

Page 46: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSVAR

The SYSVAR function retrieves information about MVS, TSO/E, and the current session, such as levels of software available, your logon procedure, and your user ID.

Page 47: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.1

Page 48: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.2

Page 49: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.2 (output)

Page 50: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Additional Program

Page 51: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

1

1 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

This course has been prepared by Milos Forman for MCoE needs only!

7) Built-in functions

• Built-in Function overview,• Non SSA Built-in Functions • TSO External Functions..

Resources: TSO/E REXX Reference

TSO/E REXX User’s Guide

There is only subset of functions. See the resources for the others.

Page 52: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

2 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

PROPRIETARY AND CONFIDENTIAL INFORMATION

TO THE EXTENT PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS DOCUMENTATION "ASIS" WITHOUT WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIEDWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ORNONINFRINGEMENT. IN NO EVENT WILL CA BE LIABLE TO THE END USER OR ANY THIRDPARTY FOR ANY LOSS OR DAMAGE, DIRECT OR INDIRECT, FROM THE USE OF THISDOCUMENTATION, INCLUDING WITHOUT LIMITATION, LOST PROFITS, BUSINESSINTERRUPTION, GOODWILL OR LOST DATA, EVEN IF CA IS EXPRESSLY ADVISED OF SUCHLOSS OR DAMAGE.THE USE OF ANY PRODUCT REFERENCED IN THIS DOCUMENTATION AND THISDOCUMENTATION IS GOVERNED BY THE END USER’S APPLICABLE LICENSE AGREEMENT.The manufacturer of this documentation is CA, Inc.Provided with "Restricted Rights" as set forth in 48 C.F.R. Section 12.212, 48 C.F.R. Sections52.227-19(c)(1) and (2) or DFARS Section 252.227.7013(c)(1)(ii) or applicable successorprovisions.

RESTRICTED RIGHTS LEGEND

These education materials and related computer software program (hereinafter referred to asthe "Education Materials") is for the end user’s informational purposes only and is subject tochange or withdrawal by CA, Inc. at any time.These Education Materials may not be copied, transferred, reproduced, disclosed ordistributed, in whole or in part, without the prior written consent of CA. These EducationMaterials are proprietary information and a trade secret of CA. Title to these EducationMaterials remains with CA, and these Education Materials are protected by the copyright lawsof the United States and international treaties. All authorized reproductions must be markedwith this legend.

Page 53: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

3

3 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

This course has been prepared by Milos Forman for MCoE needs only!

What is a function?

• A pre-written subroutine.

• A function returns a value.

• The function name is suffixed with brackets, which are used for any arguments.

• REXX has a number of supplied functions.

Let us look to some of them.

Page 54: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

4

4 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

datatype() - tests the meaning or type of characters in a string:

say datatype(“AA”,A)

Where AA is the string and A is the type. In this case it returns 1, because the string matches the type (alphanumeric).

Page 55: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

5 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

Page 56: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

6

6 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATATYPE()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 57: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

7

7 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

POS(), LASTPOS()

returns the position of the last occurrence of one string, needle, in another,haystack.

pos() - returns the position of one string, in another.

lastpos() - returns the position of the last occurrence of one string in another.

Page 58: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

8

8 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

POS(), LASTPOS() examples

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 59: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

9

9 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LEFT(), RIGHT()

left() - returns a string of length, containing the leftmost length.

right() - returns a string of length, containing the rightmost length.

Page 60: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

10

10 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LEFT(), RIGHT() examples

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 61: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

11

11 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

strip() – returns string with leading or trailing characters or both removed.

Page 62: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

12 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

Page 63: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

13

13 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

STRIP()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 64: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

14

14 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SUBSTR()

substr() - returns the substring of string that begins at the nth character and is of length.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 65: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

15

15 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

ABBREV()

abbrev() – returns 1 if info is equal to the leading characters of information, and the length of prefix is not less than length.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 66: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

16

16 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TRANSLATE()

translate() – returns string with each character translated to another character.

Page 67: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

17

17 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TRANSLATE()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 68: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

18

18 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DELSTR()

delstr() – returns string after deleting the substring that begins at the nth character and is of length characters.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 69: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

19

19 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

INSERT()

insert() – inserts the string new, padded or truncated to length length, into the string target after the nth character.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 70: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

20

20 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

OVERLAY()

overlay() – returns the string target, which, starting at the nth character, is overlaid with the string new, padded or truncated to length length.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 71: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

21

21 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

CENTRE()

center() – returns a string of length length with string centered in it, with pad characters added as necessary to make up length.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 72: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

22

22 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SPACE()

space() – returns the blank-delimited words in string with n pad characters between each word.

Page 73: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

23

23 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SPACE()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 74: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

24

24 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

FORMAT()

format() – returns number, rounded and formatted.

Page 75: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

25

25 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

FORMAT()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 76: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

26

26 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

COMPARE(), COPIES()

compare() – returns 0 if the strings, string 1 and string 2, are identical. Otherwise, returns the position of the first character that does not match.

copies() – returns n concatenated copies of string.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 77: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

27

27 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

LENGTH(), REVERSE()

length() – returns the length of string.

reverse() – returns string, swapped end for end.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 78: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

28

28 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DELWORD()

delword() – returns string after deleting the substring that starts at the nth word and is of length blank-delimited words.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 79: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

29

29 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

SUBWORD(), WORD()

subword() – returns the substring that starts at the nth word, and is up to length blank-delimited words.

word() – returns the nth blank-delimited word in string or returns the null string if fewer than n words are in string.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 80: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

30

30 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

WORDINDEX(), WORDLENGTH()

wordindex() – returns the position of the first character in the nth blank-delimited word in string or returns 0 if fewer than n words are in string.

wordlength() – returns the length of the nth blank-delimited word in string or returns 0 if fewer than n words are in string.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 81: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

31

31 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

WORDS()

words() – returns the number of blank-delimited words in string.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 82: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

32

32 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Arithmetic Functions

abs(number) – returns absolut value of number.

min(number) – returns smallest number from the list.

max(number) – returns largest number from the list.

random(number) – returns quasi random number from the range.

sign(number) – returns sign of number.

trunc(number) – returns integer part of number.

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 83: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

33

33 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

date() – returns the local date.

Page 84: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

34 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 85: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

35 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

Page 86: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

36

36 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

DATE()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 87: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

37

37 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

time() – returns the local time.

Page 88: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

38 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

Page 89: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

39

39 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TIME()

See ‘MCOE.REXA.REXX(BUILTFUN)’

Page 90: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

40

40 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functions

In addition to the built-in functions, TSO/E provides external functions that you can use to do specific tasks:

GETMSG - returns in variables a system message issued during an extended console session. It also returns in variables associated information about the message.

LISTDSI - returns in variables the data set attributes of a specified data set.

MSG - controls the display of TSO/E messages. The function returns the previous setting of MSG (ON/OFF).

MVSVAR - uses specific argument values to return information about MVS, TSO/E, and the current session.

OUTTRAP - traps lines of TSO/E command output into a specified series of variables. The function call returns the variable name specified.

Page 91: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

41

41 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functions

PROMPT - sets the prompt option ON/OFF for TSO/E interactive commands. The function returns the previous setting of prompt.

SETLANG - retrieves and optionally changes the language in which REXX messages are displayed. The function returns the previous language setting.

STORAGE - retrieves and optionally changes the value in a storage address. Carefully!

SYSCPUS - returns in a stem variable information about all CPUs that are on-line.

SYSDSN - returns OK if the specified data set exists; otherwise, it returns an appropriate error message.

SYSVAR - uses specific argument values to return information about the user, terminal, language, exec, system, and console session.

Page 92: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

42

42 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsLISTDSI

You can use the LISTDSI (List Dataset Information) function to retrieve detailed information about a data set’s attributes.

LISTDSI does not support tape datasets. LISTDSI supports GDG data sets when using absolute generation names, but does not support relative GDG names. LISTDSI does not support HFS data sets.

See ‘MCOE.REXA.REXX(DSNINFO)’

Page 93: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

43

43 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsMVSVAR

MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the security label of the TSO/E session.

The MVSVAR function is available in any MVS address space.

See ‘MCOE.REXA.REXX(MVSINFO)’

Page 94: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

44

44 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSCPUS

SYSCPUS places, in a stem variable, information about those CPUs that are on-line.

The SYSCPUS function runs in any MVS address space.

On a z990 machine or later, all CPU numbers are identical; therefore, SYSCPUS returns the same value for all CPUs.

See ‘MCOE.REXA.REXX(CPUINFO)’

Page 95: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

45

45 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSDSN

SYSDSN returns whether the specified data set exists and is available for use. The dsname can be the name of any cataloged data set or cataloged PDS with a member name. Additionally, if you specify a member of a PDS, SYSDSN checks to see if you have access to the data set.

SYSDSN does not support tape datasets. SYSDSN supports generation data group (GDG) data sets when using absolute generation names, but does not support relative GDG names.

See ‘MCOE.REXA.REXX(DSNINFO)’

Page 96: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

46

46 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

TSO/E External functionsSYSVAR

The SYSVAR function retrieves information about MVS, TSO/E, and the current session, such as levels of software available, your logon procedure, and your user ID.

SYSVAR function is very similar to MVSVAR but there is different set of arguments.

See ‘MCOE.REXA.REXX(SYSINFO)’

See more examples in „TSO REXX Users Guide“

Page 97: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

47

47 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.1

You should use nested functions translate and date.

Page 98: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

48

48 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.2

It checks only the first name – FN.

Page 99: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

49

49 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Work section 7.2 (output)

Page 100: 7) Built-in functions · TSO/E External functions MVSVAR MVSVAR returns information about MVS, TSO/E, and the current session, such as the symbolic name of the MVS system, or the

50

50 Copyright ©2006 CA. All rights reserved. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Additional Program