Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Running Jes2 command using Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Running Jes2 command using Rexx
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

Senior Member


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

PostPosted: Tue Mar 04, 2014 10:22 pm    Post subject: Reply to: Running Jes2 command using Rexx
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    Post subject:
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 User


Joined: 31 Dec 2009
Posts: 437
Location: London

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

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

Active User


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

PostPosted: Thu Mar 27, 2014 10:26 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Mar 28, 2014 12:06 am    Post subject: Reply to: Running Jes2 command using Rexx
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us