IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Running Jes2 command using Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Fahad

New User


Joined: 30 Jan 2014
Posts: 4
Location: Pune

PostPosted: Tue Mar 04, 2014 9:11 pm
Reply with quote

I am trying to run the Jes2 command $d spl,all using Rexx and want to capture the output in dataset. But I am getting only some part of the output in DS, For other command I am getting complete output. Please Check where I am making mistake.


am getting below output:-
Code:
$HASP893 VOLUME(SPOLDB) 404                         
$HASP893 VOLUME(SPOLDB)  STATUS=ACTIVE,SYSAFF=(ANY),
$HASP893                 TGNUM=24660,TGINUSE=6731, 
$HASP893                 TRKPERTGB=2,PERCENT=27,   
$HASP893                 RESERVED=NO,MAPTARGET=NO     


Correct ouput should be:
Code:
$HASP893 VOLUME(SPOLDB) 404                         
$HASP893 VOLUME(SPOLDB)  STATUS=ACTIVE,SYSAFF=(ANY),
$HASP893                 TGNUM=24660,TGINUSE=6731, 
$HASP893                 TRKPERTGB=2,PERCENT=27,   
$HASP893                 RESERVED=NO,MAPTARGET=NO   
$HASP893 VOLUME(SPOLDA) 405                         
$HASP893 VOLUME(SPOLDA)  STATUS=ACTIVE,SYSAFF=(ANY),
$HASP893                 TGNUM=24660,TGINUSE=6690, 
$HASP893                 TRKPERTGB=2,PERCENT=27,   
$HASP893                 RESERVED=NO,MAPTARGET=NO   
$HASP646 27.2120 PERCENT SPOOL UTILIZATION         





Code:
/*REXX*/                                   
ADDRESS TSO  "CONSPROF SOLDISP(NO)"       
CMD.1='D GRS,C'                           
CMD.2='D SMF'                             
CMD.3='$D SPL,ALL'                         
"CONSOLE ACTIVATE"                         
DO X=1 TO 3                               
"CONSOLE SYSCMD("CMD.X")"                 
MCODE=GETMSG('RESMSG1.','SOL',,,3)         
IF RESMSG1.0 = 0 THEN DO                   
  SAY 'NO MESSAGE RETURNED'               
  "CONSOLE DEACTIVATE"                     
  "CONSPROF SOLDISP(YES)"                 
  RETURN                                   
END                                       
ELSE                                       
  DO I=1 TO RESMSG1.0                     
    SAY RESMSG1.I                         
  END                             
  RESMSG1.0=0                     
  END                             
  "CONSOLE DEACTIVATE"           
  "CONSPROF SOLDISP(YES)"         
  EXIT
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Mar 04, 2014 10:22 pm
Reply with quote

What happens when you put '$D SPL,ALL' first in the list of commands.

Code:
"CONSOLE SYSCMD("CMD.X")"                 
MCODE=GETMSG('RESMSG1.','SOL',,,3)

You issue the command then immediately get the response. I am not sure, but it might be a timing problem where you do not wait long enough for a response.
Back to top
View user's profile Send private message
Fahad

New User


Joined: 30 Jan 2014
Posts: 4
Location: Pune

PostPosted: Wed Mar 05, 2014 6:21 pm
Reply with quote

I tried using the command '$D SPL,ALL' separatly.Then also I am getting the only part of output. can anyone please advice.

Note:- I tried to run the same rexx pgm with different command and was getting complete output. Problem is only with Jes2 command.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 582
Location: London

PostPosted: Thu Mar 27, 2014 9:02 pm
Reply with quote

Explore the OUTTRAP option
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Mar 27, 2014 10:26 pm
Reply with quote

I'm pretty sure Pedro is correct when he says it's a timing problem. $DSPL has to do I/O to collect the utilization statistics it reports and that takes a little while. Long, long ago JES2 could keep free space information in the checkpoint so no I/O would be required, but that was long, long ago, long before the $DSPL command was envisioned.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Mar 28, 2014 12:06 am
Reply with quote

I think you are getting the partial response so the GETMSG continues. It does not know to wait for more responses. Try using the SLEEP statement to pause a little before issuing GETMSG:
Code:

Call syscalls 'ON'
...
"CONSOLE SYSCMD("CMD.X")"                 
Address syscall "sleep" 30
MCODE=GETMSG('RESMSG1.','SOL',,,3) 
Back to top
View user's profile Send private message
Fahad

New User


Joined: 30 Jan 2014
Posts: 4
Location: Pune

PostPosted: Tue Apr 15, 2014 12:05 am
Reply with quote

I got the complete output with the below code. For Jes2 we must use more Getmsg function based on how many Jes2 message we get.

"CONSOLE SYSCMD("$D SPL,ALL")"
MCODE=GETMSG('RESMSG1.','SOL',,,3)
MCODE=GETMSG('RESMSG2.','SOL',,,3)
MCODE=GETMSG('RESMSG3.','SOL',,,3)
Here 'RESMSG3. contains only msg -> $HASP646 27.2120 PERCENT SPOOL UTILIZATION.

Thanks Pedro and all for your time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top