SYSTEM-COMMAND

File 46
Statement FIND
  Task Execute TSO commands online or in batch.

TSO commands can be issued in Natural environments from TP monitors other than TSO.

Up to 50 commands and sub-commands are allowed.


Fields

Dictionary Field Name F/L Mu DE Remarks
ERROR-CODE N3      
ERROR-TEXT A58      
SYSTEM-MESSAGE-CODE A10      
NODE N5   D  
NODE-NAME A16   D  
LINE A132      
COMMAND A80 M20 D  
SUB-COMMAND A80 M50 D Command line for an FTP server. Up to 50 Sub-Commands are allowed.

Field Descriptions

Field Name Type/Length
LINE (A132)

Output line. If more than one output line is expected, a FIND loop is required to retrieve all of them.

Field Name Type/Length
COMMAND (A80)  (M20)

Commands to be executed by TSO.

Field Name Type/Length
SUB-COMMAND (A80) (M50)

For COMMAND FTP, commands specific to FTP are set up in field SUB-COMMAND. Up to 50 SUB-COMMANDS are allowed. SUB-COMMANDS are only allowed for ONE COMMAND in a FIND or PROCESS statement.

As an example see section How to run an FTP from Mainframe Natural Using Entire System Server. Using the new sub-command key PASSWORD will prevent the password to appear unencrypted, e.g. in traces or outputs.

Examples

TSO Command LIST to Request a List of All Datasets

The following program issues the TSO command LIST and requests a list of all datasets that start with the string WKK:

FIND     COMMAND WITH  COMMAND = 'LISTC LVL (''WKK'')'
  DISPLAY LINE (AL=79)
  END

Output from the program:

IKJ56644I NO VALID TSO USERID, DEFAULT USER ATTRIBUTES USED
  READY
  PROFILE PREF(WKK     )
  READY
  LISTC LVL ('WKK')
  NONVSAM ------- WKK.BROKER.API.C
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.BROKER.API.LIST
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.BROKER.API.LOAD
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.BROKER.API.OBJ
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.CLOG
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.COMN.IV123.SYSTEM
       IN-CAT --- UCAT.COM811
  NONVSAM ------- WKK.DUMP

How to run an FTP from Mainframe Natural Using Entire System Server

Using the view SYSTEM-COMMAND, you may execute an FTP from Natural to anywhere, as shown in the example below. First, ask your TCP/IP administrator for the configuration information required by the TCP/IP client programs. This dataset/member is allocated dynamically with a special DDNAME SYSTCPD. The dataset/member name will of course be different at your installation.

Then, code the command FTP, and the subsequent FTP commands are coded here as SUB-COMMANDS.

In the following example, you logon as an anonymous user to the Software AG FTP server and read a list of directories or files available at this moment.

DEFINE DATA LOCAL
01 SYSTEM-COMMAND  VIEW OF SYSTEM-COMMAND
  02 LINE
END-DEFINE
FIND    SYSTEM-COMMAND  WITH NODE = 148
 AND COMMAND = 'alloc f(systcpd) da(''sysm.daef.parmlib(tcpdata)'') shr'
    AND COMMAND = 'FTP                   '
    AND SUB-COMMAND = 'ftp.softwareag.com'
    AND SUB-COMMAND = 'anonymous'
    AND SUB-COMMAND = 'PASSWORD=abc@softwareag.de'
    AND SUB-COMMAND = 'dir        '
    AND SUB-COMMAND = 'help       '
    AND SUB-COMMAND = 'quit    '
  PRINT  LINE(AL=132)
END-FIND
END  

The output looks like this:

PROFILE PREF(WKK     )

READY
ALLOC F(SYSTCPD) DA('SYSM.DAEF.PARMLIB(TCPDATA)') SHR
READY
FTP
>EZA1736I FTP
>EZY2640I Using /etc/ftp.data for local site configuration parameters.
>EZA1450I IBM FTP CS V1R8
>EZA1456I Connect to ?
>EZA1736I ftp.softwareag.com
>EZA1554I Connecting to: server21.softwareag.com 193.26.193.60 port: 21.
>220 Software AG FTP Server ready
>EZA1459I NAME (ftp.softwareag.com:WKK):
>EZA1701I >>> USER anonymous
>331 Anonymous login ok, send your complete email address as your password.
>EZA1789I PASSWORD:
>EZA1701I >>> PASS
>230-
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >> S O F T W A R E   A G
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >> Hello 10.20.91.61, there are 5 (max 10) users logged in
> >> at the moment.
> >> Local time is: Tue Sep 18 16:56:02 2007
> >>
> >> Please use your email address as password and NOT silly words
> >> like "mozilla@" or "WWWuser@", as some Web browsers do!
> >>
> >> If you have any questions concerning this ftp archive, please
> >> send a mail to firewall-admins@softwareag.com
> >>
> >> All transfers are logged! If you don't like this, disconnect now.
> >> ------------------------
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>230 Anonymous access granted, restrictions apply.
>EZA1460I Command:
>EZA1736I dir
>EZA1701I >>> PORT 10,20,91,61,7,78
>200 PORT command successful.
 >EZA1701I >>> LIST
 >150 Opening ASCII mode data connection for file list.
 >EZA2284I drwxrwxr-x   2 40       150         12288 Sep 18 11:50 incoming
 >EZA2284I drwxrwxr-x  30 40       150          4096 Sep 18 14:25 outgoing
 >226 Transfer complete.
 >EZA1460I Command:
 >EZA1736I help
 >EZA1576I User-FTP understands these commands:
 >EZA1577I !         ?          acct      append   ascii     big5       binary
 >EZA1577I block     ccc        cd        cdup     clear     close      compress
 >EZA1577I cprotect  debug      delete    delimit  dir       dump       ebcdic
 >EZA1577I euckanji  feature    file      get      glob      hangeul    help
 >EZA1577I ibmkanji  jis78kj    jis83kj   ksc5601  language  lcd        lmkdir
 >EZA1577I locsite   locstat    lpwd      ls       mdelete   mget       mkdir
 >EZA1577I mode      mput       noop      open     pass      private    prompt
 >EZA1577I protect   proxy      put       pwd      quit      quote      record
 >EZA1577I rename    restart    rmdir     safe     schinese  sendport   sendsite
 >EZA1577I site      sjiskanji  srestart  status   stream    structure  sunique
 >EZA1577I system    tchinese   tso       type     ucs2      user       verbose
 >EZA1578I Specify a command by any unambiguous prefix
 >EZA1579I Specify a local data set by qualifier.qualifier... with optional
 >EZA1580I member as (member).  Enclose fully qualified names in quotes
 >EZA1581I For information about a particular command, say 'HELP command'
 >EZA1460I Command:
 >EZA1736I quit
 >EZA1701I >>> QUIT
 >221 Goodbye.
 READY
 END

Default Order of Data Returned

Each line of the output listing is presented in order.