New HLLX Exits
If you have not installed ZMF 8.1 yet and tried the high level exits out you need to soon. In addition to giving us the flexibility to use COBOL, REXX or any other high level language, the developer have made it easy to get variables and even easier to pass variables between stages or even between sessions.
Today I just want to share how to use REXX to read a file for validating the Work Request ID. -- It sounds simple but until now unless you were able to program in assembler or only accessed ZMF through the ISPF interface it wasn't possible. The sample code is just that -- probably not that useful in a production environment -- but it depends. Remember that a REXX program can't read a VSAM file so you have copy it to a flat file or use another language. Also since there is no TSO environment in the high level exit you have to use BPX WDYN to allocate and free files - this is a standard utility on all mainframes.
Here is the example of that call:
RC = BPXWDYN("ALLOC DD("ddname") DA('"dsn"') REUSE SHR")
Remember we could have just as easily made a web services call to another system -- made XML calls and or in theory read a DB2 database. May be if things slow down a little I will put together some more examples of how to expand the use of HLLX in ZMF.
/* REXX */
/* This is a sample program that validates the work request number
against a flat file of valid codes. -- this is just for demo purposes --
*/
/* step 1 if not successfull process will stop */
proceed = "NO"
/* Read the file with valid numbers into an stem */
x=Read_dsn(CMNPS.TMAVOR.REQUEST.FILE)
say "Number of Records:" REQ.0
/* Format the number to be compared */
testField = strip(workChangeRequest)
testfield = right(testField,12,"0")
Read_dsn:
arg dsn
rc = 0
ddname = "DD1"
RC = BPXWDYN("ALLOC DD("ddname") DA('"dsn"') REUSE SHR")
rcrc = rc
if rcrc <> 0 then say 'error allocating dataset' rcrc
else do
"EXECIO * DISKR "ddname"( stem REQ. FINIS"
rcrc = rc
if rcrc <> 0 then say 'error reading dataset' rcrc
else ,
RC = BPXWDYN("FREE DD("ddname")")
end
Return rcrc
DISCLAIMER:
Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Email to a Friend
- Report Inappropriate Content