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

Dataset name with timestamp as qualifier.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Mar 29, 2010 4:13 am
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Mar 29, 2010 5:35 am
Reply with quote

Does TRAILER1 respond with an empty input dataset?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Mar 29, 2010 5:36 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Mar 29, 2010 6:40 am
Reply with quote

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
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Mar 29, 2010 7:57 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 29, 2010 8:18 am
Reply with quote

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
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Mar 29, 2010 4:34 pm
Reply with quote

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
View user's profile Send private message
Suresh Shankarakrishnan

New User


Joined: 11 Jul 2008
Posts: 42
Location: USA

PostPosted: Mon Mar 29, 2010 5:04 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Mar 29, 2010 7:08 pm
Reply with quote

You're welcome - good to hear it is working icon_smile.gif

Thank you for letting us know,

d
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top