×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Rexx loop

Rexx loop

Rexx loop

(OP)
Hello,

I'm new using REXX. I would like to build a script that will generate jobs that require to loop the Jobname field. For example. I have to copy 500 DSN's but I need to submit the copy jobs five at time.

What I have built so far is able to create all 500 copy jobs

But upon adding the new rexx code, it loops the jobname COPY01 - COPY05 to every single DSN. Leaving me with 2500 copy jobs, basically 5 copy jobs for every single DSN. I would only like to break down all 500 copy jobs so they will only loop the jobname once through the first 5 DSN's and continue looping until all 500 built.

Thanks.

Here is what I have so far:

DO FOREVER
"EXECIO 1 DISKR INFILE"
IF RC = 2 THEN LEAVE
PULL INFILE_REC

I=00
DO TC=I TO 05 BY 1

DSN = SUBSTR(INFILE_REC,1,10)

JDSN = DSN


QUEUE "//COPY"TC" JOB (P,VZFT,XO0938),'DSN-"JDSN"', "

RE: Rexx loop

I have not got a real idea of what you are doing! You are doing a FOREVER with no END and a DO i = 0 TO 5 also with no END. Assuming this is a code snipptet and the ENDs are further on what this is doing is:
read a record
repeat the following 5 times
QUEUE a job

Are you doing 5 copies in one job or one copy per job. If the latter, why are you bothering to do 5 at a time?
You do know that the commment field on the job card is limited to 22 bytes (unless it has been changed in recent years)?


Nic

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close