Automating SNDNETSPLF in CL

140 pts.
Tags:
CL
SNDNETSPLF
I want to use SNDNETSPLF to automatically copy each occurance of a specific spool file to another outq for archiving purposes.  The spool file name will always be the same.  To use SNDNETSLF I need to enter the Jobname, User & job number etc.  How do I automate the command?

Software/Hardware used:
Iseries, AS/400, CL

Answer Wiki

Thanks. We'll let you know when a new response is added.

By using RTVJOBA CL Command you can fetch the Job Name, Job Number & Job User.
<pre> DCL VAR(&JUSER) TYPE(*CHAR) LEN(10)
DCL VAR(&JNAME) TYPE(*CHAR) LEN(10)
DCL VAR(&JNBR) TYPE(*CHAR) LEN(6)
DCL VAR(&JOUTQ) TYPE(*CHAR) LEN(10)
DCL VAR(&JOUTQLIB) TYPE(*CHAR) LEN(10)
RTVJOBA JOB(&JNAME) USER(&JUSER) NBR(&JNBR) +
OUTQ(&JOUTQ) OUTQLIB(&JOUTQLIB)
</pre>

Use the Job name, User & Job Number in SNDNETSPLF for automating in CL.

Pradeep.

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    To use SNDNETSLF I need to enter the Jobname, User & job number etc. How do I automate the command? How will you know which jobs will create the needed spooled files? If you can provide a logical description of how you would do it manually, it can be converted into program logic. But maybe that's not needed. The spool file name will always be the same. If it always uses the same printer file (which is a little different from having the same name), then change that printer file to go to a new *OUTQ. Create that new *OUTQ as a remote *OUTQ that points to wherever your SNDTCPSPLF would point to. Let the system create the archive copy automatically. In order to have a copy in two *OUTQs, also change the printer file to be SAVE(*YES). After the copy is made to the archive *OUTQ, a copy will remain in the original *OUTQ in status SAV. Tom
    125,585 pointsBadges:
    report
  • ITDavid
    Pradeep Thanks, that works perfectly, I like your suggestion Tom, but it's not every instance that the spool file will require copying (sending) to another OUTQ. Thanks anyway.
    140 pointsBadges:
    report
  • Splat
    We use a combination of a data queue attached to output queues, SNDTCPSPLF, and a file specifying spool files and associated actions to distribute and archive various reports.
    7,635 pointsBadges:
    report
  • Oldtonew
    Splat We have a similar situation to what you are describing but our solution is lacking the functionality that yours seems to have. Can you expand a little more on how you setup you solution or lead me to the appropriate documentation? OldtoNew
    135 pointsBadges:
    report
  • Splat
    We've a permanent data queue attached to some output queues. The data queue (LGT IBM) is defined as follows:
    D Data            Ds                 
    D  function                     10   
    D  type                          2   
    D  job_name                     10   
    D  user_name                    10   
    D  job_number                    6   
    D  spool_file                   10   
    D  spool_num_bin                 8b 0
    D  outq_name                    10   
    D  outq_library                 10   
    D                               56
    We have a control file, defined as follows:
    SOQ10   (10)   Source output queue         
    SOQL10   (10)   Source output queue library 
    SPFN10   (10)   Spool file name             
    USER10   (10)   User name                   
    SEQ#10   (5 2)   Sequence number             
    ACT10   (8)   Action                      
    TOQ10   (10)   Target output queue         
    TOQL10   (10)   Target output queue library
    I have a self-submitting program that runs every thirty minutes, calling this program to look for any new entries in the data queue (there's another program called that distributes reports by e-mail). The actions allowed to the program are *COPY, *DELETE, *HOLD, *MOVE, *SAVE. If you want, give me your e-mail & I'll bundle up the source. Not all of it's pretty - it kind of grew out of an earlier version I inherited.
    7,635 pointsBadges:
    report
  • TomLiotta
    I have a self-submitting program that runs every thirty minutes... Self-submitting? As in SBMJOB every 30 minutes? How does it start? Why submit rather than just run continuously? But the basic idea works well. The program waits on entries to the *DTAQ that is fed by spooled files going to RDY status on the *OUTQ. Whenever an entry appears, the program does whatever tests are needed to determine if any action should be taken. But I'm also curious about the earlier element -- "but it’s not every instance that the spool file will require copying". What makes that decision? If the decision is known by the job that creates the report, then how does it communicate that to the job that does the copy? It would be easier just to have the original job put the spooled file into either the archive *OUTQ or the normal *OUTQ. The archive *OUTQ would be the one that sent copies to the normal *OUTQ thereby having a copy when needed. And if the original job can't make the decision, the RTVJOBA won't help. Tom
    125,585 pointsBadges:
    report
  • Splat
    The initial run I did manually; at LR time the program adds 30 minutes to the current timestamp for the next scheduled date/time. At the time I was looking to avoid creating a new subsystem and modifying existing subsystems wasn't feasible (still isn't, really). The output queues I monitor aren't attached to printers so I needn't worry about something disappearing from the system before I've had a chance to perform any necessary actions.
    7,635 pointsBadges:
    report
  • TomLiotta
    ...to avoid creating a new subsystem and modifying existing subsystems wasn’t feasible Run it through QSYSNOMAX. No changes needed, and that's one of the reasons it exists. You could have it be an auto-start job, but that does require some minor change somewhere. Tom
    125,585 pointsBadges:
    report
  • Splat
    Hadn't thought of QSYSNOMAX. When I've got a bit of time I'll look into it. Thanks.
    7,635 pointsBadges:
    report
  • Oldtonew
    Splat, Thank you for the explanation. I think that with this information we will be able to add some functionality to our system and maybe be able to let some users administer their own settings, within reason of course OldtoNew.
    135 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following