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.
/*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
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.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
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.
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
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: