Mukunda Beginner
Joined: 11 Dec 2002 Posts: 46 Topics: 15
|
Posted: Mon Jun 02, 2003 1:48 pm Post subject: |
|
|
For the benefit of those who want to try out their fingers at ISPF skeletons, I'm posting the REXX macro and skeleton JCL.
REXX MACRO
Code: | /*REXX*/
arg NEWDS OLDDS
if (NEWDS = '') then do
say "Missing New file name - to be created"
exit
end
if (OLDDS = '') then do
say "Missing Existing file name - to be cloned"
exit
end
/* Look at the current CLIST dataset for skeletons */
"ispexec libdef ispslib library id(sysproc)"
/* open the skeleton and output to temp dataset */
"ispexec ftopen temp"
"ispexec ftincl DSCLONE" /*DSCLONE is where the skeleton jcl lies*/
/* close the output */
"ispexec ftclose"
"ispexec vget (ztempf) shared"
/*submits JCL at temp dataset */
"submit '"ztempf"'"
exit 0 |
JCL SKELETON
Code: | //*
//**********************************************************************
//* TO CREATE A FILE (PS/PDS) BY CLONING ATTRIBUTES OF ANOTHER FILE *
//**********************************************************************
//*
//STEP010 EXEC PGM=IEFBR14
//CREAT DD DSN=&NEWDS,
// LIKE=&OLDDS,
// DISP=(,CATLG,),
// UNIT=SYSDA
//*
//**********************************************************************
//* TO COPY THE CONTENTS OF OLDDS TO NEWDS CREATED AT STEP010 *
//**********************************************************************
//*
//STEP020 EXEC PGM=SORT
//SORTIN DD DSN=&OLDDS,
// DISP=SHR
//SORTOUT DD DSN=&NEWDS,
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=Q
//* |
You can invoke this from the command line with
Code: | <REXX MACRO MEMBER NAME> NEW.DATASET EXISTING.DATASET |
It will be easy (avoids confusion ) if we keep both the rexx macro and the skeleton jcl in the same PDS. |
|