Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2086
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: 445
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 Member


Joined: 30 Nov 2013
Posts: 574
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: 2086
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us