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

Looping in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suvarna

New User


Joined: 24 Aug 2005
Posts: 13

PostPosted: Wed Aug 24, 2005 2:46 pm
Reply with quote

Is it possible to loop in JCL?
That is i want to insert around 20 DD DSN='file name', DISP=SHR for each file name.This is for the purpose of merging all these files to a single report file.
Now I am manually inserting each of these steps. If I have these file names in a seperate file is it possible by some means to insert DD DSN='file name', DISP=SHR for each of these files and then do a merge for these files?
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Aug 24, 2005 4:21 pm
Reply with quote

As you describe your problem I suppose that you want to append your files to an output, is true?
My advise is to connect/concatenate your input as show in the JCL User's Guide at the link below:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/IEA5B506/4.2.1.4?DT=19971021190515

This advise has one mainly reason: if you append data(with disposition MOD in ouptut) you must create first a dataset with correct space not released and so you may have two(but only one of that) problem: first is that space is not enough; the second is that unnecessary space, at the end of your work is not released.

If you want to persevere with MOD disposition you must to know that JCL can't loop but can only restart and to do what you need you can use: or a restart or a proc instream or catalogued.

In every case I suggest you to search in this forum before posting because this argument is aleady treated.
Back to top
View user's profile Send private message
Prandip

New User


Joined: 04 Mar 2005
Posts: 84
Location: In my tiny cubicle ...

PostPosted: Wed Aug 24, 2005 6:27 pm
Reply with quote

If the dataset names are listed in another dataset, why not just use an INCLUDE statement to use the list:

Example: the PDS 'MY.PARMLIB(LIST)' contains the list of datasets for concatenation:
//SYSUT1 DD DISP=SHR,DSN=MY.DSN1
// DD DISP=SHR,DSN=MY.DSN2
....
// DD DISP=SHR,DSN=MY.DSN20

Then, use this member in your job:

Code:

//MYJOB JOB (acctg,....)
//*
// JCLLIB ORDER=MY.PARMLIB
//*
//STEPXXXX EXEC PGM=IEBGENER
// INCLUDE MEMBER=LIST
//SYSUT2 DD DSN=MY.NEW.COMB.DSN,DISP=(MOD,CATLG,DELETE),...
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
Back to top
View user's profile Send private message
ajayvamsi

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Thu Sep 01, 2005 2:51 am
Reply with quote

Hi Prandip,
u r right u can specify thru INCLUDE statment and the path of that member can be specified the JCLLIB ...thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts LMDINIT/LIST/FREE Looping problem TSO/ISPF 12
No new posts Looping in JCL JCL & VSAM 9
No new posts Looping in JCL CLIST & REXX 20
No new posts Looping REXX - unable to interrupt CLIST & REXX 3
Search our Forums:

Back to Top