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

Can a parm be passed to a proc to control an instream file?


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

New User


Joined: 08 Apr 2005
Posts: 45

PostPosted: Wed Aug 26, 2009 2:46 am
Reply with quote

I have this job that'll convert a specified dataview of a table into a COBOL copybook:


Code:

***************************** Top of Data ***************************
//RJMDVWDP JOB (NA7Z7M01),'NAOTB70',CLASS=0,MSGCLASS=J,
//        NOTIFY=&SYSUID
//*
//*
//*-----------------------------------------------------------------*
//* DUMP ALL DVW TO COBOL COPYBOOK                                  *
//*-----------------------------------------------------------------*
//STEP010  EXEC DDDUTLTY
//SYSPUNCH  DD DISP=OLD,DSN=CP2787.IDEAL.COPYLIB(DVWTEST)
//SYSIN     DD *
-USR DATACOM-INSTALL,NEWUSER
-UTL LANGUAGE,COBOL
-UTL COPY,TABLE,SHP-SC(PROD),'CUT HERE'
-END
//*-----------------------------------------------------------------*
//* END OF JOB                                                      *
//*-----------------------------------------------------------------*


It works fine. Now I have a slew of dataviews to convert so I want to make a proc where I call the above step. In the above what I want to vary from call to call is the output destination (DVWTEST in the PDS) and the table name (SHP-SC). So I ended up making this JCL to call a new proc:


Code:

********************************* Top of Data ****************
//DBISORT  JOB (NA7Z7M01),'DBI SORT   ',CLASS=0,MSGCLASS=J,
//        NOTIFY=&SYSUID
//*----------------------------------------------------------*
//* DUMP A DATAVIEW                                          *
//*----------------------------------------------------------*
//LIBRARY  JCLLIB  ORDER=(CP2787.IDEAL.PROCLIB)
//*
//*
//*----------------------------------------------------------*
//* EXPLANATION HERE OF VARIOUS INPUTS                       *
//*----------------------------------------------------------*
//DVW2COPY EXEC  DVW2COPY,
//        OUTNAME=DVWROB,
//        DVWNAME=SHP-SC
//*----------------------------------------------------------*
//* END OF JOB                                               *
//*----------------------------------------------------------*
******************************** Bottom of Data **************


This is the proc:

Code:

//*----------------------------------------------------------*
//DVW2COPY PROC OUTNAME=DVWTEST,
//         DVWNAME=SPUD
//*
//*
//*----------------------------------------------------------*
//* DUMP ALL DVW TO COBOL COPYBOOK                           *
//*----------------------------------------------------------*
//STEP010 EXEC DDDUTLTY
//SYSPUNCH  DD DISP=OLD,DSN=CP2787.IDEAL.COPYLIB(&OUTNAME)
//SYSIN     DD *
-USR DATACOM-INSTALL,NEWUSER
-UTL LANGUAGE,COBOL
-UTL COPY,TABLE,&DVWNAME.(PROD),'CUT HERE'
-END
//*----------------------------------------------------------*
//* END OF PROC                                              *
//*----------------------------------------------------------*


The job bombs when I run:


Code:

13 XXSYSPUNCH  DD DISP=OLD,DSN=CP2787.IDEAL.COPYLIB(&OUTNAME)
   IEFC653I SUBSTITUTION JCL - DISP=OLD,DSN=CP2787.IDEAL.COPYLIB(DVWROB)
   X/SYSPUNCH DD DUMMY
14 XXSYSUDUMP DD SYSOUT=&SOUT
   IEFC653I SUBSTITUTION JCL - SYSOUT=*
15 XXSNAPER   DD SYSOUT=&SOUT
   IEFC653I SUBSTITUTION JCL - SYSOUT=*
16 XXDDSNAP   DD SYSOUT=&SOUT
   IEFC653I SUBSTITUTION JCL - SYSOUT=*
17 XXSYSIN     DD *
18 -USR DATACOM-INSTALL,NEWUSER
19 -UTL LANGUAGE,COBOL
20 -UTL COPY,TABLE,&DVWNAME.(PROD),'CUT HERE'
21 -END
   XX*----------------------------------------------------------*
   XX* END OF PROC                                              *
   XX*----------------------------------------------------------*

Code:

STMT NO. MESSAGE
       3 IEFC001I PROCEDURE DVW2COPY WAS EXPANDED USING PRIVATE LIBRARY CP2787.
       3 IEFC657I THE SYMBOL DVWNAME WAS NOT USED
       5 IEFC001I PROCEDURE DDDUTLTY WAS EXPANDED USING SYSTEM LIBRARY SYS3.PRO
       8 IEFC002I INCLUDE GROUP DBMUFD#S WAS EXPANDED USING SYSTEM LIBRARY SYS3
      17 IEFC601I INVALID JCL STATEMENT
      18 IEFC601I INVALID JCL STATEMENT
      19 IEFC601I INVALID JCL STATEMENT
      20 IEFC601I INVALID JCL STATEMENT
      21 IEFC601I INVALID JCL STATEMENT


I think I've run into this problem before and given up: It looks like I can not use a parm in an instream file in a proc. On the otherhand the OUTNAME parm works fine.

Is that right and is there a way around that?
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Wed Aug 26, 2009 3:19 am
Reply with quote

Thats right, no symbolic substitution in in stream data. And no DD * in a PROC, either.

Usually folks create a REXX or other utility to read a file of values, generate the JCL and submit it.
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Mon Nov 02, 2009 5:28 pm
Reply with quote

Hi ,

I have a similar requirement for creating a copybook structure using SYSPUNCH as input .

Can we create DCLGEN in batch at run time .
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 Nov 02, 2009 8:58 pm
Reply with quote

Hello Rishi,

Is there some reason your question is posted in the JCL part of the forum? Might it be better seved in the DB2 part of the forum?

Quote:
Can we create DCLGEN in batch at run time .
Please clarify what this is asking. I do not understand the question icon_confused.gif
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Nov 03, 2009 10:27 am
Reply with quote

Hi Dick,

I have a feel that the topic being discussed above is very similar to what my requirement is.

Well for the DCLGEN part ...

I need to create a JCL thru which i just pass in the Table name and The DB2 subsystem name and in result i get the cobol equivalent data declaration of the fields ( i.e. a DCLGEN but in Batch mode)

let me know if i have made myself clear.

Thanks,
Rishi
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Nov 03, 2009 10:31 am
Reply with quote

Div Grad wrote:
I have this job that'll convert a specified dataview of a table into a COBOL copybook:


Code:

***************************** Top of Data ***************************
//RJMDVWDP JOB (NA7Z7M01),'NAOTB70',CLASS=0,MSGCLASS=J,
//        NOTIFY=&SYSUID
//*
//*
//*-----------------------------------------------------------------*
//* DUMP ALL DVW TO COBOL COPYBOOK                                  *
//*-----------------------------------------------------------------*
//STEP010  EXEC DDDUTLTY
//SYSPUNCH  DD DISP=OLD,DSN=CP2787.IDEAL.COPYLIB(DVWTEST)
//SYSIN     DD *
-USR DATACOM-INSTALL,NEWUSER
-UTL LANGUAGE,COBOL
-UTL COPY,TABLE,SHP-SC(PROD),'CUT HERE'
-END
//*-----------------------------------------------------------------*
//* END OF JOB                                                      *
//*-----------------------------------------------------------------*


It works fine. Now I have a slew of dataviews to convert so I want to make a proc where I call the above step. In the above what I want to vary from call to call is the output destination (DVWTEST in the PDS) and the table name (SHP-SC). So I ended up making this JCL to call a new proc:




Hi Div,

I need a simillar kind of a JCl to create a copybook structure for a DB2 table's view.
Can you pass me the same JCL.

Thanks,
Rishi
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 Nov 03, 2009 10:36 am
Reply with quote

Hello,

That jcl and control statements are for CA-Datacom and use the Datacom DataDictionary Utility.

It is not at all related to db2/dclgen.
Back to top
View user's profile Send private message
Rishi Khare

New User


Joined: 13 Aug 2007
Posts: 16
Location: Mumbai

PostPosted: Tue Nov 03, 2009 10:41 am
Reply with quote

Hi Dick,

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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
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
Search our Forums:

Back to Top