|
View previous topic :: View next topic
|
| Author |
Message |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
To a query posted by hyuzen on July 9 , 2005, Finding Duplicate Records, Frank presented a solution.
I used his JCL listed below.
My requirement is the same - to add date/timestamp as the last qualifier in the dataset name.
The following JCL which returns a condition code of zero, but the dataset is not created.
Am I missing something?
| Code: |
//ACCSXS4P JOB (124060SYS),'ACCSXS4P',
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1)
//STEP0002 EXEC PGM=SORT
//SORTIN DD *
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'//ACCSXS JOB (TEST),CLASS=A,MSGCLASS=X',/,
C'//STEP0001 EXEC PGM=IEFBR14',/,
C'//FILE0001',
C' DD DSN=PHRD.TRANSFER.EMAIL',DATENS=(DMY),C'.NVSAM,',/,
C'// UNIT=DISK,SPACE=(TRK,(5,5)),',/,
C'// DISP=(NEW,CATLG,DELETE)')
/* |
|
|
| Back to top |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| Does TRAILER1 respond with an empty input dataset? |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Running the job as you have posted it, I see one problem. The dataset name in the job ACCSXS resolves to
PHRD.TRANSFER.EMAIL280310.NVSAM
which is of course an illegal name and causes a JCL error. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what does the output from generated job say ?
The job that returned a 0 condition code submits a job to the INTRDR,
this is the job that needs investigation.
Gerry |
|
| Back to top |
|
 |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
Thanks all.
William, I believe TRAILER1 does not respond with an empty dataset since the third qualifier exceeds the maximum length for a dataset.
--------------------------------------------------------
superk,
Yes, the dataset name is invalid as you stated, and the JCL errors.
I only looked at the output under ACCSXSP and not under ACCSXS.
I shortened the third qualifier to one letter to make the name valid.
The datset created as per the JCL is PHRD.TRANSFER.A280310.NVSAM
------------------------------------------------------------
gcicchet,
INTRDR was new to me. I did not look the output under ACCSXS as stated above.
------------------------------------------------------------
The JCL listed above has the following addition -
| Code: |
C'// DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB)'
//ACCSXS4P JOB (124060SYS),'ACCSXS4P',
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1)
//STEP0002 EXEC PGM=SORT
//SORTIN DD *
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'//ACCSXS JOB (TEST),CLASS=A,MSGCLASS=X',/,
C'//STEP0001 EXEC PGM=IEFBR14',/,
C'//FILE0001',
C' DD DSN=PHRD.TRANSFER.A',DATENS=(DMY),C'.NVSAM,',/,
C'// UNIT=DISK,SPACE=(TRK,(5,5)),',/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB)')
/*
--------------------------------------------------------------- |
My requirement was to take a backup of dataset.prd for example in a dataset with timestamp as qualifier. That way, a rerun of the JCL on the 'same day' would not error.
Can a timestamp component - hhmmss (hour,minute,second) be added to the above JCL in addition to the date?
For example, the dataset name after the addition of the time component will be PHRD.TRANSFER.A280310.Bxxxxxx.NVSAM where 'xxxxxx' is the timestamp. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Why not simply make sure the "previous" backup is deleted before the "current" one is created? Change the trailer to submit 2 steps - one to housekeep and the other to catalog the dataset. Then there would be no need to create a hodge-podge of datasets that will need to be managed . . . |
|
| Back to top |
|
 |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
Dick,
Multiple backups are required in order to help in researching data. Of course, taking backups in a GDG would be the easier option. |
|
| Back to top |
|
 |
Suresh Shankarakrishnan
New User
Joined: 11 Jul 2008 Posts: 42 Location: USA
|
|
|
|
Dick,
Thanks. As you suggested, the JCL was modified to delete and recreate the dataset. It works.
This works if the job is run once a day.
If the requirement is to take backups multiple times in one day, then this will not work as each backup dataset within the same day needs to have a timestamp, but in that case, using a GDG would be easier.
| Code: |
//ACCSXS4P JOB (124060SYS),'ACCSXS4P',
// CLASS=A,
// MSGCLASS=X,
// MSGLEVEL=(1,1)
//STEP0001 EXEC PGM=SORT
//SORTIN DD *
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(C'//ACCSXS JOB (TEST),CLASS=A,MSGCLASS=X',/,
C'//STEP0000 EXEC PGM=IEFBR14',/,
C'//DEL1 DSN=PHRD.TRANSFER.A',DATENS=(DMY),C'.NVSAM,',/,
C'// DISP=(MOD,DELETE,DELETE),',/,
C'// UNIT=DISK,SPACE=(TRK,0)')
/*
//STEP0002 EXEC PGM=SORT
//SORTIN DD *
//SORTOUT DD SYSOUT=(*,INTRDR)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER2=(C'//ACCSXS JOB (TEST),CLASS=A,MSGCLASS=X',/,
C'//STEP0001 EXEC PGM=IEFBR14',/,
C'//FILE0001',
C' DD DSN=PHRD.TRANSFER.A',DATENS=(DMY),C'.NVSAM,',/,
C'// UNIT=DISK,SPACE=(TRK,(5,5)),',/,
C'// DISP=(NEW,CATLG,DELETE),',/,
C'// DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB)')
/* |
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - good to hear it is working
Thank you for letting us know,
d |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|