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

Rexx to execute spool commands


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Fri Sep 29, 2017 1:08 pm
Reply with quote

I have the below query,

I have run the below job to execute spool commands through batch and coded a Rexx routine to execute the below commands.

Code:
//USER01TS JOB (),'EXAMPLE',NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1),
// MSGCLASS=X
//SDSF EXEC PGM=SDSF
//ISFOUT DD SYSOUT=*
//CMDOUT DD DSN=USER01.COMMAND.OUTPUT,
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0),
// SPACE=(CYL,(1,1)),UNIT=SYSDA
//ISFIN DD *
SET CONSOLE BATCH
SET DELAY 600
/D A,L
/$ D SPOOL
PRINT FILE CMDOUT
ULOG
PRINT
PRINT CLOSE
/*
//


In Both cases (Batch JCL and Rexx) Am getting command outputs to CMDOUT Dataset but am able to see same output in SPOOL as well.

My requirement is I want command outputs to CMDOUT dataset and I dont want them in SPOOL , Because I have requirement to execute Multiple spool commands(More than 1000)
Is there any way to avoid output of spool commands in Spool and re-direct them to dataset?

Thanks!
Upendra

Coded
Please do it yourself next time
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Sep 29, 2017 2:09 pm
Reply with quote

What have you tried? There seems to be one JCL statement that could be altered to attempt what you want.
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Fri Sep 29, 2017 5:17 pm
Reply with quote

Hi Nic,

Thank you for your response. I have coded the below Rexx

"ALLOC DD(ISFOUT) DA('TEST1.SPOOL.OUT1') SHR REUSE"
"ALLOC DD(CMDOUT) DA('TEST2.JES.OUTPUT') MOD REUSE"
"ALLOC DD (ISFIN) NEW REU"
QUEUE " SET CONSOLE BATCH "
QUEUE " SET DELAY 600 "
QUEUE " /£DJQ '"J"',SPL "
QUEUE " PRINT FILE CMDOUT "
QUEUE " ULOG "
QUEUE " PRINT "
QUEUE " PRINT CLOSE "
"EXECIO "QUEUED()" DISKW ISFIN (FINIS"
"CALL *(SDSF)"
END

TEST1.SPOOL.OUT1 - This file contains Job names ( Which are in spool )

After reading this file am submitting the above Jes command to know the spool percentage occupied by those Jobs.

Am getting expected output in CMDOUT dataset but am able to see all those commands which executed during this process in Spool. Commands are more than 1000.

So I need to execute those commands and I want their ourput in my dataset but I dont want to see them in Spool.

Thanks!
Upen.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Sep 29, 2017 5:40 pm
Reply with quote

Quote:
So I need to execute those commands and I want their ourput in my dataset but I dont want to see them in Spool.


if You do not want to see them, do not look at them icon_cool.gif

why does it bother You, as long as You get the output also in Your dataset ?
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Fri Sep 29, 2017 5:49 pm
Reply with quote

Hi Enrico,

Yeah.. you are true. But these commands occupying spool and we have people to Monitor spool .

Thanks!
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Sep 29, 2017 7:08 pm
Reply with quote

You still have not addressed the hint that I gave you about a possible change in your JCL - one of the DDNAMEs is allocated to spool. What happens when it is dummied or pointed elsewhare?
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Fri Sep 29, 2017 7:44 pm
Reply with quote

Hi Nic,

I have tried both as below

1.
//SDSF EXEC PGM=SDSF
//ISFOUT DD DUMMY
//CMDOUT DD DSN=TEST.COMMAND.OUTPUT,DISP=SHR
//ISFIN DD *
SET CONSOLE BATCH
SET DELAY 600
/DJQ TEST0001,SPL
PRINT FILE CMDOUT
ULOG
PRINT
PRINT CLOSE
/*
//

2.
//SDSF EXEC PGM=SDSF
//ISFOUT DD DSN=TEST.COMMAND.OUTPUT,DISP=SHR
//CMDOUT DD DSN=TES1.COMMAND.OUTPUT,DISP=SHR
//ISFIN DD *
SET CONSOLE BATCH
SET DELAY 600
/D SMS
PRINT FILE CMDOUT
ULOG
PRINT
PRINT CLOSE
/*
//

In both cases am able to see the below output in spool

D SMS
IGD002I 15:11:00 DISPLAY SMS 461
SCDS = LSWN.N1SMS.SCDS
ACDS = LSWN.N1SMS.ACDS
COMMDS = LSWN.S1SMS.COMMDS
ACDS LEVEL = z/OS V2.2
DINTERVAL = 150
REVERIFY = NO
ACSDEFAULTS = NO
SYSTEM CONFIGURATION LEVEL INTERVAL SECONDS
PLEXS1 2017/09/29 15:10:53 15
IEA631I OPERATOR BATCH NOW INACTIVE, SYSTEM=BSOS , LU=BATCH

Thanks!
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Sep 30, 2017 5:40 am
Reply with quote

You might also try a job message class where the output is deleted after the job runs.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Sat Sep 30, 2017 6:29 am
Reply with quote

The $DQ command does not display the SPOOL utilization of a single job. It displays the current SPOOL utilization of the system. I think you better crack open the z/OS JES2 Commands manual for your z/OS release.

Rather than use operator commands you'd be better off looking at the TGPct column in the SDSF job status output.
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 6:57 am
Reply with quote

Hi Pedro,

Thank you. But what I need is through this Job am going to execute multiple commands (More than 1000) , Even If I delete the Job from spool , The commands processed by this job will there in spool. So I want to avoid them.

My requirement is : My Commands should be executed in background and those commands and outputs should not showed in spool.

Thanks!
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 7:08 am
Reply with quote

Hi Steve,

Am issuing the below Jes command to know the Spool percentage occupied by a job in spool

/$DJQ 'JOBNAME',SPL

Here is an example.

/$DJQ 'TESTNEW1',SPL
£HASP890 JOB(TESTNEW1)
£HASP890 JOB(TESTNEW1) SPOOL=(VOLUMES=(IN1103,04,01,02),TGS=8,
£HASP890 PERCENT=0.0039)

In case if we get similar Result using TGPct column , Can you please assist me how to check Spool percentage used by single job using TGPct column?



Thanks!
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Sep 30, 2017 1:48 pm
Reply with quote

I don't think that you can avoid that command output is copied to spool when using SDSF batch.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Sep 30, 2017 1:50 pm
Reply with quote

I strongly suggest that you look at the SDSF REXX API. With that you can avoid some of the displays.
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 2:28 pm
Reply with quote

Hi Willy Jensen,

Okay. Is there anyway to know the spool percentage used by a single Job other than issuing Jes command?



Thanks!
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Sep 30, 2017 3:22 pm
Reply with quote

Certainly. The STATUS display gives you the TGPCT amongst other info. Look in SDSF, if the information is shown on a screen, you can most likely get the same info from the REXX API. I know that TGPCT is available.
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 3:46 pm
Reply with quote

Hi Willy Jensen,

Actually I have compare both Jes spool command TGPCT as below

TKSR 00000290 $DJQ 'TTSYTKSR',SPL
JOB63125 00000090 $HASP890 JOB(TTSYTKSR) 685
685 00000090 $HASP890 JOB(TTSYTKSR) SPOOL=(VOLUMES=(SPS101),TGS=1,
685 00000090 $HASP890 PERCENT=0.0019)


NP JOBNAME PrtDest SecLabel TGNum TGPct OrigNode ExecNode Devic
TTSYTKSR LOCAL 1 0.00 LOCAL LOCAL


For the Job TTSYTKSR From the Jes spool command spool percentage is : 0.0019

But for the same Job TGPCT showed as 0.00.

Not sure how to relate them. Tried reading manual but TGPCT information is not understandable to me.

Can you give me an example?

Thanks!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat Sep 30, 2017 3:52 pm
Reply with quote

upendrasri wrote:

For the Job TTSYTKSR From the Jes spool command spool percentage is : 0.0019

But for the same Job TGPCT showed as 0.00.

Not sure how to relate them.

Sheesh, ever heard about rounding?
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 3:57 pm
Reply with quote

Hi Prino,

Oh yeah got it but I want to know the actual spool percentage occupied by that particular Job?

Is there anyway to get the actual value rather than Rounding of TGPCT?

Thanks!
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 4:09 pm
Reply with quote

Hi Prino,

If am not wrong, TGPCT is showing only two digits after dot(.)

From my above example Spool percentage from Jes command is : 0.0019

TGPCT Value is : 0.00

Seems it is not considering 3rd and 4th digits. I have tried with another example.

JOB63237 00000090 $HASP890 JOB(TTSYTKSR) 689
689 00000090 $HASP890 JOB(TTSYTKSR) SPOOL=(VOLUMES=(SPS101),TGS=15,
689 00000090 $HASP890 PERCENT=0.0299)

TGPCT Value is : 0.02

Correct me in case if my understanding is wrong.

Thanks!
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat Sep 30, 2017 4:29 pm
Reply with quote

So it doesn't round, but it truncates, big deal...
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Sat Sep 30, 2017 5:04 pm
Reply with quote

Well, if you really need all that precision - unlikely, but that's only my opinion - you can calculate the percentage yourself by adding the total track groups from the spool volumes from the SDSF SP comand and then use the TGNUM value from the job status display to compute the percentage to any precision you like. As prino sometimes says, sheesh.

On the other hand, if you want the largest spool usage, just use TGNUM from job status and don't get bent out of shape by percentage. Then, at least, you don't have fractions and rounding or truncation!
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Sep 30, 2017 5:48 pm
Reply with quote

As prino quite correctly states, the value is truncated by the x.xx pct. Question is, how precise do you really need the result? Truncating or rounding, the value will still not be precise.
By the way, the REXX API shows values with the same precision as the screens. The width of TGPCT is defined as 6 bytes.

REXX API sample (just in case):
Code:
 parse value '* STA* **' with isfprefix isfowner isfsysname isfdest   
 zz=isfcalls('ON')                                                   
 Address SDSF "ISFEXEC ST (delayed prefix @.)"                       
 if rc<>0 then ....
 zz=isfcalls('OFF')                                                   
 do n=1 to @.jname.0                                                 
   say @.jname.n @.jobid.n @.queue.n @.status.n space(@.retcode.n,0),
       @.ownerid.n @.tgpct.n                                         
 end
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Sep 30, 2017 11:04 pm
Reply with quote

Hi Prino,

I tried getting TGPCT Full value from SDSF Panel but I failed in getting full value.

Can you please give me a hint or assist me on this?

Thanks!
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sun Oct 01, 2017 6:37 am
Reply with quote

Hi,

I tried getting TGPCT Value without truncation using existing ST Panel exec, But its really confusing for me.

Is there any ISPF Function related to TGPCT value? or is there any Rexx variable like ISFTGPCT From which we can access this value based on Jobid?

Thanks!
Back to top
View user's profile Send private message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sun Oct 01, 2017 6:52 am
Reply with quote

Hi,

I tried getting TGPct value without truncation from SDSF ST Panel exec but its really confusing for me.

Can somebody help me in getting TGpct full value? or provide me some hint to get that value.

Thanks!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
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
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top