Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
pass STEM to compiled programs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
XOpen

New User


Joined: 19 Mar 2008
Posts: 24
Location: Russia

PostPosted: Fri Mar 21, 2008 6:06 pm    Post subject: pass STEM to compiled programs
Reply with quote

Now a real question: As we know, REXX can't pass stem to external REXX function, but at the same time we have EXECIO that can get it.

How do they do it ? Is there any TSO service for that ? (asm?)
Back to top
View user's profile Send private message
References
PostPosted: Fri Mar 21, 2008 6:06 pm    Post subject: Re: pass STEM to compiled programs Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2655
Location: italy

PostPosted: Fri Mar 21, 2008 6:16 pm    Post subject: Reply to: pass STEM to compiled programs
Reply with quote

EXECIO is quite resource consuming for such a task
reading and writing an external dataset at every call .. brrrrr

what do You mean by compiled programs...
REXX compiled or external functions written in assembler or a supported HLL ?

from an organizational point of view is a bad habit to call
rexx written external commands...

because of
1 - library setup,
usually the best way to distribute rexx aplications is to make them self contained
2 - performance issues
3 -as You already noticed some drawbacks in parameters passing

assuming that You have the rexx compiler available the best thing from any point of view is to expose the stems
an %include the subroutines/functions at rexx compile time

in the other thread I had proposed some external functions, but
Back to top
View user's profile Send private message
XOpen

New User


Joined: 19 Mar 2008
Posts: 24
Location: Russia

PostPosted: Fri Mar 21, 2008 6:23 pm    Post subject:
Reply with quote

No. I am interested in the way. I would like to write my own program(not necessary on REXX) and call it from REXX and pass stem to it. Then I will decide, does it fit or not. (Again it's not about passing stem from REXX to REXX)
Back to top
View user's profile Send private message
pauly_william

New User


Joined: 15 Oct 2007
Posts: 10
Location: Canada

PostPosted: Fri Apr 11, 2008 8:50 pm    Post subject: What seems to work
Reply with quote

I've been able to pass a stem variable values between diff REXX functions by looping through and queueing the values to the data stack, then looping through the data stack and extracting the values. I did this for a function to grab all the dataset names that had the pattern "JAN97, JAN01, JAN07, etc" and then QUEUE them in the data stack in decending order then loop them out of the data stack using Do Queued()...PARSE PULL. Too easy!

Code:
Gen_OptionBox:                                                         
  Address TSO 'NEWSTACK'                                               
  q = 1                                                                 
  Call OPSUBYY /* Ext. sub that uses TSO LISTCAT to gen drop-down box*/
  Do Queued()                                                           
     Parse Pull vYYYY.q                                                 
     q = q + 1                                                         
  End                                                                   
  Address TSO 'DELSTACK'                                               
  If q > 1 then vYYYY.0 = q - 1                                         
  Else q = 1                                                           
Return       



Code:
/* Rexx **/   
/* Function: generate year list for dropdown box, Queue to stack.     */   
 
X = OUTTRAP("lst.")                                                         
Address TSO "LISTCAT LEVEL(SOME.DATASET.LOG)"                             
X = OUTTRAP("OFF")                                                         
Y9min = 99                                                                 
Y0min = 00                                                                 
Y0max = 00                                                                 
Do i = 1 to lst.0                                                           
   parse var lst.i . . dsname .                                             
   parse var dsname . "." . "." . "." dsnmth                               
   i = i + 1                                                               
   If DATATYPE(substr(dsnmth,4,1)) ¬= "NUM" Then iterate                   
   If substr(dsnmth,4,1) = "9" Then                             /* Y2k */   
   Do                                                                       
     YYtemp = substr(dsnmth,4,2)                                           
     If YYtemp < Y9min Then Y9min = YYtemp              /* bubble sort */   
   End /* If Do */                                                         
   Else                                                                     
   Do                                                                       
     YYtemp = substr(dsnmth,4,2)                                           
     If YYtemp > Y0max Then Y0max = YYtemp              /* bubble sort */   
     else                                                                   
       If YYtemp < Y0min Then Y0min = YYtemp                               
   End /* Else Do */                                                       
End i /* end i loop */                                                     
If Y9min ¬= '00' Then                                                       
Do                                                                         
  YYmin = Y9min                                                             
  YYmax = Right(Y0max,2,'0')                                               
end /* If Do */                                                             
Else                                                                       
Do                                                                         
  YYmin = Right(Y0min,2,'0')                                               
  YYmax = Right(Y0max,2,'0')                                               
End /* else Do */                                                           
If substr(YYmin,1,1) ¬= "9" Then /* if year in Y2K start count down */     
  Do                                                                       
    YYdiff = YYmax - YYmin                                                 
    Do i = 1 to YYdiff + 1                                                 
      Queue '20'||YYmax                                                     
      YYmax = Right(YYmax - 1,2,'0')                                       
    End i /* end i loop */                                                 
End /* if Do */                                                             
Else Do                          /* start count down but factor in '90s*/   
    YYdiff = YYmax                                                         
    Do i = 1 to YYdiff + 1                                                 
      Queue '20'||YYmax                                                     
      YYmax = Right(YYmax - 1,2,'0')                                       
    End i /* end i loop */                                                 
  YYmax = 99                                                               
  If YYmin < 99 Then         
    Do                       
      YYdiff = 99 - YYmin     
      Do i = 1 to YYdiff + 1 
        Queue '19'||YYmax     
        YYmax = YYmax - 1     
      End i /* end loop */   
   End /* If Do */           
   Else                       
     Queue '1999'             
End /* Else do */



I honestly don't know if this the ideal way...but that being said the performance seems to be fine accomplishing what I need.
Back to top
View user's profile Send private message
pauly_william

New User


Joined: 15 Oct 2007
Posts: 10
Location: Canada

PostPosted: Fri Apr 11, 2008 8:52 pm    Post subject:
Reply with quote

XOpen wrote:
(Again it's not about passing stem from REXX to REXX)

Did read the question entirely....DOH! lol
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1