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

Creating N number of datasets


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

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Wed Dec 07, 2005 10:31 am
Reply with quote

Hi Team,

Can anyone give an idea of how to allocate N number of datasets using a single JCL


eg:

if i want to create

TEMP.TEMP.DATE01
TEMP.TEMP.DATE02
TEMP.TEMP.DATE03
TEMP.TEMP.DATE04

like this UPTO DATE10. not using GDG.......

Moderator please delete this topic in VS COBOL II
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Wed Dec 07, 2005 10:41 am
Reply with quote

Use IEFBR14
Code:
//SHAA5   EXEC PGM=IEFBR14, 
//             COND=(4,LT)   

//SHZ51       DD  DSN=TEMP.TEMP.DATE01,           
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE),   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)   
//*                                                 
//SHZ52       DD  DSN=TEMP.TEMP.DATE02,           
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE),   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)   
//*                                                 
//SHZ53       DD  DSN=TEMP.TEMP.DATE03,           
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE),   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)   
//*                                                 
//SHZ54       DD  DSN=TEMP.TEMP.DATE04,           
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE),   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)   
//*                                                 
.
...
..
..
.
.
//SHZ10       DD  DSN=TEMP.TEMP.DATE10,           
//            DISP=(NEW,CATLG,DELETE),             
//            UNIT=SYSDA,SPACE=(TRK,(5,2),RLSE),   
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)   
//*


hope this helps.
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Wed Dec 07, 2005 11:57 am
Reply with quote

hi Radhakrishnan,


Thanks for the help....but i meant for creating Temporary datasets...if its for a 100 or 500 datasets ??? how to create using the same.....
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Wed Dec 07, 2005 12:50 pm
Reply with quote

It can be done using REXX.
Back to top
View user's profile Send private message
yogesh

New User


Joined: 27 May 2005
Posts: 21

PostPosted: Wed Dec 07, 2005 4:54 pm
Reply with quote

If u r making the temp d/s , u need not have to use any utility
just use dd statement with &&prefixed
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Dec 07, 2005 6:54 pm
Reply with quote

Use IDCAMS:
Code:

//ALLOC    EXEC PGM=IDCAMS,DYNAMNBR=255
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
   DELETE ('TEMP.TEMP.DATE01')
   ALLOC DATASET('TEMP.TEMP.DATE01') -
     NEW CATALOG UNIT(unit) SPACE(pri,sec) CYLINDERS -
     RECFM(recfm) LRECL(lrecl) BLKSIZE(0)
   ...
   DELETE ('TEMP.TEMP.DATE0n')
   ALLOC DATASET('TEMP.TEMP.DATE0n') -
     NEW CATALOG UNIT(unit) SPACE(pri,sec) CYLINDERS -
     RECFM(recfm) LRECL(lrecl) BLKSIZE(0)
   IF MAXCC > 0 THEN SET MAXCC=0 
/*
//*
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Mon Dec 12, 2005 6:13 pm
Reply with quote

hey superk

Thank you so much for the info
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Fri Mar 03, 2006 10:22 pm
Reply with quote

Hi superk,

The code given by above, i tried it but it is creating only 2 datasets.
The first one and the last one.

Can u clarify me regarding this....

thanks in advance
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Mar 04, 2006 12:11 am
Reply with quote

You'll probably need to post your messages.

I just tried it with 9 sets of DELETE/ALLOCATE commands and it worked just fine.
Back to top
View user's profile Send private message
sonu_winks

New User


Joined: 23 Nov 2005
Posts: 23

PostPosted: Mon Mar 06, 2006 3:31 pm
Reply with quote

Hi, Gautam..

u have to code it for N number of times..not that the above code creates N no of data sets :-).

Superk am i rite?
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 308
Location: Vizag / US

PostPosted: Mon Mar 06, 2006 6:25 pm
Reply with quote

Hi superk,

here is the sysin card :

Code:
ALLOC DATASET('CC923GB.TSOAREL.TEMP01') -       
  NEW CATALOG UNIT(PRMDA) SPACE(1,0) CYLINDERS -
  RECFM(F) LRECL(133) BLKSIZE(0)               
...                                             
ALLOC DATASET('CC923GB.TSOAREL.TEMP05') -       
  NEW CATALOG UNIT(PRMDA) SPACE(1,0) CYLINDERS -
  RECFM(F) LRECL(133) BLKSIZE(0)               
IF MAXCC > 0 THEN SET MAXCC=0 


the three dots mentioned will be taken by the jcl automatically or we need to give all the dataset names.....

Thanks in advance
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Mar 07, 2006 7:38 am
Reply with quote

Gautam512 wrote:
...the three dots mentioned will be taken by the jcl automatically or we need to give all the dataset names.....

We need to give all the dataset names, of course.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Fri Apr 25, 2008 3:24 pm
Reply with quote

Hi Nirmal,

Here is a small cobol program and JCL for creating N no of dataset. I have tested with 10 dataset. Its working fine for me... U can also try it

WORKING-STORAGE SECTION.
01 WS-COUNT PIC 9(2) VALUE ZEROES.
PROCEDURE DIVISION.
PERFORM XXXX-XXXX VARYING
WS-COUNT FROM 1 BY 1 UNTIL WS-COUNT > 5(No of Dataset).
STOP RUN.

XXXX-XXXX.
DISPLAY '//<ID> JOB CLASS=B,'
DISPLAY '// MSGCLASS=X,NOTIFY=&SYSUID
DISPLAY '//DSNCREAT EXEC PGM=IEBGENER'
DISPLAY '//SYSUT2 DD DSN=AISSTMP.MILN.P' WS-COUNT ','
DISPLAY '// DISP=(NEW,CATLG,DELETE),'
DISPLAY '// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0,DSORG=PS),'
DISPLAY '// SPACE=(TRK,(09,03),RLSE),'
DISPLAY '// UNIT=SYSDA'
DISPLAY '//SYSPRINT DD SYSOUT=*'
DISPLAY '//SYSOUT DD SYSOUT=*'
DISPLAY '//SYSIN DD DUMMY'
DISPLAY '//SYSUT1 DD DSN=AISSTMP.MILN.D01,DISP=SHR'
DISPLAY '//'.

JCL Structure:

//<ID> JOB CLASS=B,
// MSGCLASS=X,NOTIFY=&SYSUID
//* $ACFJ219 ACF2 ACTIVE GFSJES04
//* $ACFJ219 ACF2 ACTIVE GFSJES04
//MAILRPT EXEC PGM=DSNCRE
//STEPLIB DD DSN=AISSTMP.NGPT.LOADLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=(*,INTRDR)
//SYSIN DD DUMMY
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Fri Apr 25, 2008 3:29 pm
Reply with quote

Why reply to a 2 year old topic

which by the way was not clear at all in its requirement
( total confusion on permanent temporary concept )
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 JES datasets IO Error ABENDS & Debugging 3
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top