MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File allocation when no filename passed to proclib

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Oct 19, 2015 6:20 am    Post subject: File allocation when no filename passed to proclib Reply with quote

I'm sure I've seen this somewhere, but just can't remember where.
My proclib starts with the following
Code:

//DEFAULT  PROC SYSTEM=&SYSTEM,     
//         PROGRAM='',               
//         TABLE=&TABLE,             
//         COPYFIL=''               

(COPYFIL is optional). The DD statement I'm having problems with is the following (I appreciate this is incorrect)
Code:

//COPYFIL  DD  DUMMY.DSN=&COPYFIL,DISP=SHR   


Basically, I want COPYFIL to be a DUMMY if nothing is passed in, otherwise I want it to be allocated as (say)
Code:

//COPYFIL  DD  DSN=MYFILE.SECOND.THIRD(FOURTH),DISP=SHR   


How do I achieve this ?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Oct 19, 2015 7:37 am    Post subject: Reply with quote

COPYFIL=NULLFILE
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Oct 19, 2015 7:59 am    Post subject: Reply with quote

Yes, if you want to dummy-out by DSN, NULLFILE is the chap.

Code:
//DEFAULT  PROC SYSTEM=&SYSTEM,     
//         PROGRAM='',               
//         TABLE=&TABLE,             
//         COPYFIL='NULLFILE'


And:

Code:
//COPYFIL DD DSN=&COPYFIL,...
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Oct 19, 2015 8:07 am    Post subject: Reply with quote

Thanks to both of you; worked a treat.

Though it wasn't the solution I thought (?) I'd seen, but it's much more elegant.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Oct 19, 2015 8:13 am    Post subject: Reply with quote

Just got a reply from a colleague. I think this was the one I was thinking of (but NULLFILE is still more elegant)
Code:

//DEFAULT  PROC IN=,OUT=,OPT=C,SPIE=0,TEST=0,DIRCA=000,
//         CKPTID=NOMSGS,SSM=,                         
//         APARM=,NBA=,OBA=,                           
//         DUMMY1='DUMMY,',                           
//         DUMMY2='DUMMY,'                             

and further down
Code:

//DEL2     EXEC PGM=IEFBR14                             
//DD1      DD   &DUMMY1.DSN=&UTFIL01,DISP=(MOD,DELETE) 

and the actual parameter in the JCL calling the proc
Code:

UTFIL01=myfile.second.third(+1),
DUMMY1=,


Thanks again
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Oct 19, 2015 2:28 pm    Post subject: Reply with quote

I think it should be
Code:
//     DUMMY1='DUMMY '

Anything after the space is treated as a comment
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Oct 19, 2015 3:02 pm    Post subject: Reply with quote

The other parameters on the DD should not cause a problem. Sometimes you need the DCB info, so I think correct without the space.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group