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                                                                                                                                  

AppScript vs Form Actions/JavaScript API/JavaScrip...
Serena Service Manager & Serena Business Manager P...

Related Posts

Comments 5

 
Mike Cottam on Wednesday, 16 December 2015 14:42

I just installed 8.1.0 to start to experiment with the exits. Things seem to be working, but I can not save the changed data. I used the dataChanged = "YES" thinking that would save the data I changed. The variable I was trying to change is userVarLen401.

One of the things I have not been able to find and have had to gleen from samples is some of the keywords that make the exits work. For instance: proceed = "NO". Is there anything published other than the Getting Started Guide for the HLL exits that explains in more detail how to do things? Some of the variables like callorigin are a little vague on how to use them. Any more info would make working with the exits easier.

I just installed 8.1.0 to start to experiment with the exits. Things seem to be working, but I can not save the changed data. I used the dataChanged = "YES" thinking that would save the data I changed. The variable I was trying to change is userVarLen401. One of the things I have not been able to find and have had to gleen from samples is some of the keywords that make the exits work. For instance: proceed = "NO". Is there anything published other than the Getting Started Guide for the HLL exits that explains in more detail how to do things? Some of the variables like callorigin are a little vague on how to use them. Any more info would make working with the exits easier.
Mike Cottam on Wednesday, 16 December 2015 16:05

This is the code that is not saving the 401 variable:
If (function = 'PUPD0001' | function = 'PUPD0101') then
Do
if tempChangeDuration > 11 then
Do
proceed = "NO"
shortMsg= "Invalid duration"
longMsg= "Maximum duration is 11 days"
end

userVarLen401 = requestorDept
dataChanged = "YES"
End

This is the code that is not saving the 401 variable: If (function = 'PUPD0001' | function = 'PUPD0101') then Do if tempChangeDuration > 11 then Do proceed = "NO" shortMsg= "Invalid duration" longMsg= "Maximum duration is 11 days" end userVarLen401 = requestorDept dataChanged = "YES" End
Tom Mavor on Thursday, 17 December 2015 08:27

HI Mike

The only other thing that might help is if you look in KBTV (Knowledge Base TV) you will find a video by Steve Downs that talks a lot about HLLX. In the case of the code you have provided -- I am not sure why you care which function is used at this point. Have you done diagnostics using the Say command to ensure that the process is working correctly. One of the great things about HLLX is that you can easily trace what is going on in the exit. If you don't already know -- you should be able to see the log in the HLLX task. I would start with making sure the program is traveling the path that you expect. I addition to writing statements to the log with the SAY command you can also put TRACE ALL on. I will do what I can to assist you -- so keep in contact and let me know how it goes.

HI Mike The only other thing that might help is if you look in KBTV (Knowledge Base TV) you will find a video by Steve Downs that talks a lot about HLLX. In the case of the code you have provided -- I am not sure why you care which function is used at this point. Have you done diagnostics using the Say command to ensure that the process is working correctly. One of the great things about HLLX is that you can easily trace what is going on in the exit. If you don't already know -- you should be able to see the log in the HLLX task. I would start with making sure the program is traveling the path that you expect. I addition to writing statements to the log with the SAY command you can also put TRACE ALL on. I will do what I can to assist you -- so keep in contact and let me know how it goes.
Mike Cottam on Thursday, 17 December 2015 09:51

I have watched all the videos, but they are more along the lines of getting started. There is no explanation of functions or how to use special keywords. For instance, the PROCEED key word is not explained or even mentioned, yet it is a key piece of the process flow. The variable dataChanged is not explained or listed as something to use. I got that from looking at code. It would be nice to know what kinds of variable are out there for control the actions of Chgman. Obviously there are at least two that are really important and unless you have sample code you would have no idea they are there and how to use them.

I have watched all the videos, but they are more along the lines of getting started. There is no explanation of functions or how to use special keywords. For instance, the PROCEED key word is not explained or even mentioned, yet it is a key piece of the process flow. The variable dataChanged is not explained or listed as something to use. I got that from looking at code. It would be nice to know what kinds of variable are out there for control the actions of Chgman. Obviously there are at least two that are really important and unless you have sample code you would have no idea they are there and how to use them.
Tom Mavor on Thursday, 17 December 2015 10:11

We have talked about putting together a course. One of the issues with any kind of documentation is the volume -- People only can handle so much information but I don't disagree a little separation of the variables so -- you have the control variable separated from the data variables might help. R&D is relying mostly on the samples as a means for communicating that information.

Is there something I can do to help you with your current challenge?

We have talked about putting together a course. One of the issues with any kind of documentation is the volume -- People only can handle so much information but I don't disagree a little separation of the variables so -- you have the control variable separated from the data variables might help. R&D is relying mostly on the samples as a means for communicating that information. Is there something I can do to help you with your current challenge?

Recent Tweets