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

How to override a File name in PROC


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

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Sat May 24, 2008 9:06 pm
Reply with quote

I have a db2 program in my proc. That db2 program uses a file OLESON. I want to override that file OLESON from my JCL.

I've tried with the following.

Code:

//A010087B EXEC A010087B,                             
//         DCRDSNI=A.SD,                             
//         DCRDSNO=A.SD,                             
//         INTDSN1=A.SA.B5603.ECMINXS4.CLUSTER,       
//         ENDLIB=QUAL,                               
//         CARDLIB=QUAL,                             
//         DBLIB=QUAL,                               
//         DBSUBSY=DBQ1                               
//SORT060.SYSUDUMP DD  SYSOUT=*                       
//SORT062.SYSUDUMP DD  SYSOUT=*                       
//SORT070.SYSUDUMP DD  SYSOUT=*                       
//STEP080.SYSABOUT DD  SYSOUT=*                       
//STEP080.B6505I4  DD  DISP=SHR,DSN=Q00708.DATE.OLESON


here B6505 is the DB2 program.

I'm able to override file in non db2 programs.

Thanks
sukumar
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 May 24, 2008 9:29 pm
Reply with quote

Your code looks correct.

//PROCSTEPNAME.DDNAME DD ....

is the correct way to code a DD override.

If STEP080 is the PROC STEPNAME and B6505I4 is the DD name, your override should be working properly.
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Mon May 26, 2008 7:36 am
Reply with quote

thank you for your reply..

if the file is being used in the non db2 program,my jcl gently overrides the file.in my case, it is a DB2 program.so endup in a jcl error.the error is step080 is not found.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon May 26, 2008 8:13 am
Reply with quote

Hi,
can you show the proc or job output from failed job.


Gerry
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Mon May 26, 2008 11:17 am
Reply with quote

Hi All,

I am posting my problem in the same post instead of starting new one am also facing the same probelm.

I have also faced the same situation in case of DB2 program. I am using DSNUPROC utility in procedure and the DD name was used in proc was DSNUPROC.SYSREC00.

I wanted to override this step from JCL. Stepname in PROC for DSNUPROC utility was LOADSTEP.

I have provided following statement in JCL to override.

//LOADSTEP.DSNUPROC.SYSREC00 DD DSN=...., DISP=...

But this JOB was giving JCL error by stating INVALID LABELNAME.

PROC looks like below.

Code:
//LOADSTEP EXEC DSNUPROC
//DSNUPROC.SYSREC00 DD DISP=(OLD,KEEP,KEEP),
//     DSN=A.B.C.LOAD,       
//     SPACE=(CYL,(1000,1000),RLSE)         


JCL has been written as below.

Code:
//LOADSTEP.DSNUPROC.SYSREC00 DD DISP=...,DSN=....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon May 26, 2008 11:51 am
Reply with quote

Hi,
as mentioned earlier, to over-ride a DDname in a procedure, you need to know the DDname and the step name in which it is used inside the procedure. When you code

//stepname.ddname DD ...

in your JCL, it causes JES to insert (add or over-ride) the DDname into
the specified step inside the PROC. The resulting merged JCL is placed
in the job queue and executed.


Gerry
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon May 26, 2008 12:09 pm
Reply with quote

ksk, you need to review the rules for Nested Procedures.

It's not possible to do what you're attempting to do.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Mon May 26, 2008 12:19 pm
Reply with quote

Here is an example which i have tested and worked fine.

Code:

PROC

//TEMP5    PROC  (Proc is saved as TEMP5)                                     
//STEP010  EXEC  PGM=SORT                             
//*                                                   
//SORTIN   DD  DSN=XXXXX.XXXXX.ITM.MOVE.INPUT,   
//             DISP=SHR                               
//SORTOUT  DD  DSN=XXXXX.XXXXX.MOVE.ITEM.FILE9,   
//             DISP=(NEW,CATLG,DELETE),               
//             SPACE=(CYL,(30,5)),                   
//             UNIT=SYSDA,                           
//             DCB=(DSCB1,RECFM=FB,LRECL=129)         
//*   

Main JCL

//MAINJCL  JOB (TDEV,TST),'XXXXX',MSGCLASS=9,           
//          CLASS=H,NOTIFY=A027104,TIME=1440               
//   JCLLIB ORDER=A027104.DI.FALL07.WIP.JCLS               
//*                                                       
//STEP011  EXEC  TEMP5 (Name of the PROC)                                   
//STEP010.SORTIN DD DSN=XXXXX.XXXXX.ITM.MOVE.INPUT1   
//*                                                       
//SYSIN    DD  *                                           
  SORT FIELDS=COPY                                         
/*                                                         
//
 
XXXXX.XXXXX.ITM.MOVE.INPUT has been overridden by
XXXXX.XXXXX.ITM.MOVE.INPUT1   
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Mon May 26, 2008 12:32 pm
Reply with quote

Hi Kevin,

Thanks very much for your information.

If I want to override this already overrode dataset thru JCL, is there any other way to do it?

Because I don't want change the PROC whcih has DSNUPROC.SYSREC00 statement. I want to override this dataset with my own dataset in JCL and test it.

KSK
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 26, 2008 7:57 pm
Reply with quote

Hello,

Sri -
how does your jcl relate to the question? What you posted is rather "normal" and works many places. The "problem" is not like your solution. . .

KSK -
You might consider a test proc of the same name and put it in a different proclib for your testing.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue May 27, 2008 8:38 am
Reply with quote

Dick,

Thanks for the solution.

Sri,

Your solution is for normal cases but my requirement is different and override is not possible in my case as explained by Kevin.

Thanks,
KSK
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 27, 2008 9:07 am
Reply with quote

You're welcome icon_smile.gif

d
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Tue May 27, 2008 11:26 am
Reply with quote

ksk wrote:
Dick,

Thanks for the solution.

Sri,

Your solution is for normal cases but my requirement is different and override is not possible in my case as explained by Kevin.

Thanks,
KSK


sorry dick n KSK i misunderstood the post
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 27, 2008 9:20 pm
Reply with quote

Hello Sri,

Not a problem icon_smile.gif

Misunderstandings do happen and we try to follow up.

d
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Wed May 28, 2008 5:21 pm
Reply with quote

hi all,
thanks for ur reply.

To override the file which is used in the non-db2 program in the PROC,

put this in JCL,
//PROCSTEPNAME.DDNAME DD DSN=<DATASET NAME>

it works fine.it overrides the file given in the PROC.

To override the file which is used in the db2 program in the PROC,

put this in JCL,
//PROCSTEPNAME.DB2BATCH.DDNAME DD DSN=<DATASET NAME>

try this..this might be working.

Thanks!
Sukumar
Back to top
View user's profile Send private message
sukumar.pm

New User


Joined: 20 Dec 2007
Posts: 27
Location: chennai

PostPosted: Wed May 28, 2008 5:34 pm
Reply with quote

Hi KSk,

i think we should not directly use DSNUPROC.you take any job which ran successfully.after the run,you will be getting the expanded JCL in the spool.you try to get the stepname from corresponding utility you used to execute. that stepname should be used instead of DSNUPROC..

try this..


Sukumar
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top