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

How to copy the DD parameters of other DSN


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

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Thu Jun 21, 2007 2:10 am
Reply with quote

Hi All,

I want to copy the DD parameters of one dataset to the other without explicitely mentioning the same parameters.

Consider this piece of code

Code:
//STEP1  EXEC PGM=PGM1
//DD1    DD DSN=FILE.TEST.DATA ,DISP=(NEW,CATLG,DELETE),
// SPACE=(800,(100,20),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800) 

//DD2    DD DSN=FILE.TEST.DATA.OUTOUT



Here i want to mention the same DD parameters of DD1 to DD2, without mentioning all the parameters.....

Please Help me in this regard
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: Thu Jun 21, 2007 3:04 am
Reply with quote

Hello,

After reading the reply to your other jcl question, use the "Manuals" link mentioned and do a bit of research on "backward reference" sometimes referred to as "referback".

If there are questions on that material, please let us know.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Thu Jun 21, 2007 3:23 am
Reply with quote

Is this correct???

Code:
//STEP1  EXEC PGM=PGM1
//DD1    DD DSN=FILE.TEST.DATA ,DISP=(NEW,CATLG,DELETE),
// SPACE=(800,(100,20),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=800) 

//DD2    DD DSN=FILE.TEST.DATA.OUTOUT
//                LIKE=STEP1.DD1


Please correct me, if i'm wrong
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: Thu Jun 21, 2007 8:34 am
Reply with quote

Hello,

I believe you will need a comma after "OUTOUT" in DD2. The LIKE parameter appears to be indented too much - it needs to start in pos 16 or before.

Your best bet is to try your jcl on your system and see what happens.

Even if this works, i believe you will want more understanding of what all it did and why it did what it did. There is more info in the manual about LIKE and other methods of backward reference. There are differences in how sms-managed datasets and non-sms datasets are handled.

If you just want to copy a dataset and have the output dcb info the same as the input, you can do this automatically with IEBGENER or your SORT product.
Back to top
View user's profile Send private message
ursvmg

New User


Joined: 24 May 2007
Posts: 52
Location: Chennai

PostPosted: Fri Jun 22, 2007 1:58 am
Reply with quote

LIKE parameter is used by MVS only if SMS (System Managed Storage)
is installed and operational. For a non SMS dataset, this cannot be used.
LIKE will copy LRECL, RECFM, KEYOFF, KEYLEN, SPACE, AVGREC, and data set
organization (RECORG).

Instead for a non SMS dataset, i used this piece of code to copy the dcb parameters

Code:
//STEP1   EXEC PGM=IEBGENR               
//SYSPRINT DD SYSOUT=*   
//SYSUT1   DD DSN=X.TEST.DATA.IN,     
//             DISP=SHR                   
//SYSUT2   DD DSN=X.TEST.DATA.OUT,     
//             DISP=(,CATLG,DELETE),     
//             UNIT=SYSDA,               
//             SPACE=(CYL,(10,10),RLSE), 
//             DCB=*.SYSUT1               
//SYSIN    DD DUMMY           


This worked fine.......


Please correct me if I'm wrong....
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: Fri Jun 22, 2007 2:03 am
Reply with quote

Hello Gopal,

Yup, that should work as you wish.

If you have the time and the inclination, you might also run that job without the referback (after deleting the output file from your proof run icon_smile.gif ). The output will have a message that the output dcb info was copied from the input.

Good luck and thanks for posting your result icon_smile.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Fri Jun 22, 2007 2:14 am
Reply with quote

Too late icon_redface.gif but I think he followed your advise Dick and got somewhere here
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top