Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to override a file name in a proc

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to override a file name in a proc
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

Moderator Team Head


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

PostPosted: Sat May 24, 2008 9:29 pm    Post subject: Reply to: How to override a file name in a proc
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    Post subject: Reply to: How to override a file name in a proc
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: 1703
Location: Australia

PostPosted: Mon May 26, 2008 8:13 am    Post subject:
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: 356
Location: New York

PostPosted: Mon May 26, 2008 11:17 am    Post subject:
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: 1703
Location: Australia

PostPosted: Mon May 26, 2008 11:51 am    Post subject:
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

Moderator Team Head


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

PostPosted: Mon May 26, 2008 12:09 pm    Post subject: Reply to: How to override a file name in a proc
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: 216
Location: India

PostPosted: Mon May 26, 2008 12:19 pm    Post subject: Reply to: How to override a file name in a proc
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: 356
Location: New York

PostPosted: Mon May 26, 2008 12:32 pm    Post subject:
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

Site Director


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

PostPosted: Mon May 26, 2008 7:57 pm    Post subject:
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: 356
Location: New York

PostPosted: Tue May 27, 2008 8:38 am    Post subject:
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

Site Director


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

PostPosted: Tue May 27, 2008 9:07 am    Post subject: Reply to: How to override a file name in a proc
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: 216
Location: India

PostPosted: Tue May 27, 2008 11:26 am    Post subject:
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

Site Director


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

PostPosted: Tue May 27, 2008 9:20 pm    Post subject: Reply to: How to override a file name in a proc
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us