-2

Working on a z/OS system, and I'm not part of the programming team, but I know some programming stuff. We have a tool that we're working with that can output JCL + NDM to send files from the company to the client. I can manually add and review the output before submitting the card.

I'm looking for a way to affect the timing of the transmissions, per the clients request. I'd like to keep it simple and just modify the JCL + NDM before submitting it. They would like several minutes in between each transmission (execution of NDM script), and the time to transfer the file may vary.

What commands are available to me for that? I did some searching and it looks like most people think this is a terrible idea, though I'm not clear why (still new to mainframes).

I came across NDM's MAXDELAY, but I am not convinced that will help, it looks more like a queuing mechanism than a delay.

Another guy mentioned JCL's STARTT which could space them out.... if we knew how long it would take for them to send.

I was hoping there was something that inserts a delay. We're already setting a priority to single thread the script and send things one at a time.

Since I have JCL and NDm in the same script, I can use either to make the delay.

For reference, in other languages, most languages have a wait, delay, or other command available. Also, sometimes those commands have idiosyncrasies; Arduino stops all execution during a delay, so it's not recommended.

YetAnotherRandomUser
  • 1,320
  • 3
  • 13
  • 31
  • 2
    Your question doesn't really clarify what you are trying to do. Are you trying to send the same file on a recurring basis (like every 15 minutes) or send another one 15 minutes after the last one completed sending, or some other variant. Understanding your expectations will help answer your question. – Hogstrom Feb 04 '20 at 21:25
  • Different files after each wait period. – YetAnotherRandomUser Feb 04 '20 at 22:00
  • 1
    You have not provided enough detail to answer this question. Please provide exactly what you want to achieve, what you have tried, and what feedback you have received from the system. – Rich Jackson Feb 05 '20 at 12:39
  • @RichJackson Uh.... no. The nature of a client with a mainframe implies tons of confidentiality, so you're not getting specifics. It's a simple question, so if you need all that, you're overthinking it, or sealioning me. – YetAnotherRandomUser Feb 05 '20 at 13:52
  • 2
    @YetAnotherRandomUser Uh... OK. Client-to-Mainframe protocols are pretty simple and not necessarily proprietary. If your shop has mainframe workloads, they most likely have a scheduler, as well. Maybe you should talk to the team that manages it. You can keep your details, and I wish you good luck getting a direct answer here. – Rich Jackson Feb 05 '20 at 14:46
  • @YetAnotherRandomUser RichJackson actually made a valid point - you're not being clear. You talk about scripts with JCL and NDM in them but that's meaningless in a z/OS environment - it doesn't have scripts (only on USS but people don;t refer to that as z/OS) and by 'Priority to single thread the script' - do you mean that you are using some method to make the NDM batch jobs run one at a time? The details Rich was asking for have absolutely no bearing on client confidentiality. – Steve Ives Feb 10 '20 at 10:40
  • Do you want each batch job to run as soon as the previous transmission has completed, or do you want some further delay? Your question isn't clear. – Steve Ives Feb 10 '20 at 10:40

4 Answers4

2

If you can add a step to the JCL, then...

//WAITABIT EXEC PGM=BPXBATCH,PARM='SH sleep 10s'
//STDOUT   DD  SYSOUT=*
//STDERR   DD  SYSOUT=*

...might be what you're looking for. The sleep shell command is supplied with z/OS.

Some people worry that this ties up an initiator unnecessarily.

cschneid
  • 10,237
  • 1
  • 28
  • 39
  • Oh, that might work. I'll run it by my people and see what they say. – YetAnotherRandomUser Feb 05 '20 at 13:59
  • It might work but has a number of issues in terms of what if the job get's cancelled ... is the whole process kaput ? I don't think @rich-jackson 's questions were asking for too much detail. The OP asked a general question about delays and he was asking for more detail on your objectives, not specifics. This example might work but is necessarily general due to the vagueness of the question. Delay on fixed interval, any delay will do ya, is the delay dependent on transfer time or completion time? – Hogstrom Feb 05 '20 at 23:18
  • Why would you want to wait 10 seconds? If you’re waiting for some event then just ... wait for that event. – Steve Ives Feb 11 '20 at 22:07
  • @SteveIves Sometimes the event is "wait until an external process over which you have no control and which will not notify you when it's done has completed." I've had to deal with this situation. – cschneid Feb 12 '20 at 04:24
1

z/OS 2.2 did introduce the SCHEDULEstatement which allows to submit the job but delay execution until some specific date/time.

It could look like this:

// SCHEDULE HOLDUNTL=('02:37','02/13/2020')

But neither the HOLDUNTL nor the STARTBY parameter make any guarantees as to the exact start time.

So if you want to have a short delay you could go with cschneid's solution, for a fixed start time some later time in the future the above solution would avoid unnecessarily blocking an initiator.

piet.t
  • 11,718
  • 21
  • 43
  • 52
  • That's kind of what STARTT does. Since the transmissions might take an arbitrary mount of time, possibly longer than a few minute delay, we can't really schedule them a few mins apart in this case. In other cases, this might be a good solution. – YetAnotherRandomUser Feb 05 '20 at 13:57
1

FYI, NDM (Network Data Mover) has been called Connect:Direct for quite some time now.

Have you considered using DGADWAIT, the Run Task Wait Program?

0

That's not the way mainframes work. The idea of putting a fixed delay into a batch job means you haven't defined your process properly (Why are you waiting? What are you waiting for? Why not just use some of the myriad of tools available to you to schedule the second part of the process once whatever you are waiting for has occurred?).

If you have a bunch of files to transfer, then just submit a batch job or jobs to transmit the files and they get there when they get there. If you have a specific requirement to run the batch jobs at specific intervals then either have the process that creates and submits the JCL only do so at intervals, or you could get the software to write each file to a dataset and have another process read that file every xxx minutes and build a transmission job for the eligible files.

The problem you have is that you are trying to modify a perfectly acceptable process (build a batch job to send a file and then submit the job) to do something different, because either the client's requirements have changed (they can't receive the files in an ad-hoc fashion anymore - usually because their processes around incoming files are bad) or were not properly understood from the outset.

If you can't modify the process, then you're going to have to ad-lib it. One option would be to direct the transmission jobs to an inactive initiator (the part of the system the executes jbatch jobs) and then have some automation to briefly start and then stop the initiator every xxx minutes, allowing just one job to run at a time.

If you want each transmission to run in sequence once the previou sone has completed, then just give all the batch jobs the same name (so they have to run single-stream) and use MAXDELAY=0.

Steve Ives
  • 7,894
  • 3
  • 24
  • 55