Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dataset name with timestamp as qualifier.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Dataset name with timestamp as qualifier.
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: 3158
Location: Tucson AZ

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

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

Moderator Team Head


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

PostPosted: Mon Mar 29, 2010 5:36 am    Post subject: Reply to: Dataset name with timestamp as qualifier.
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: 1703
Location: Australia

PostPosted: Mon Mar 29, 2010 6:40 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 8:18 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 7:08 pm    Post subject: Reply to: Dataset name with timestamp as qualifier.
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us