Server Guide

Passing parameters to an OS/390 Native application

You can pass parameters to an OS/390 Native application. The way the parameters are passed differs depending on whether you are testing your application on the workstation or running your load module on OS/390.

To pass parameters to an image you are testing on the workstation, add the parameters after the image name. For example, to pass the parameters SEQFILE and READ to the image, enter the following:

esvio -imymvsapp seqfile read

The parameters are placed in an Array, in the method System commandLine. The above example would produce the following array in Smalltalk:

#('esvio.exe' '-imymvsapp' 'seqfile' 'read')

When the same application is run on OS/390, the values might not be in the same positions. For this reason, it is important to use the select: method to acquire only the values your application might need.

The following example selects only those parameters that do not begin with a dash ( - ) or a slash ( / ), each of which are reserved.

| file args |
"Select only those values not beginning with - or /"
args := System commandLine select: [ :each | ((each at: 1) = $-)
                                     and: [(each at: 1) = $/ ]].
 
"Test the size of args. There should be three parms, the command,
 the filename, and the mode"
args size = 3
   ifFalse: [^Transcript cr;
                  show: 'The syntax of the command is not correct'].
 
"Open the file; in element one of args is esvio.exe,
                   element two of args is seqfile,
                   element three of args is read"
(file := SrvBasicFileDescriptor open: (args at: 2)
                                mode: (args at: 3)) isSrvFileError
  ifTrue: [^Transcript cr;
                show: 'Open error code: ', file rc printString].

By using the select: method to pull only those values that are returned on both OS/390 and the workstation, you can ensure that the same code that runs on the workstation will also run on OS/390.

To pass parameters to an image you are running on OS/390, add the parameters after the image name in the ABTBEXEC JCL. If there are multiple parameters, they must be separated by a space. For example, to send the parameters SEQFILE and READ to the application image, you would specify the following:

//STEP1    EXEC PGM=&IMAGE,PARM='SEQFILE READ'

The same example code above that opens the file on the workstation will open the file on OS/390.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]