MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Current date and time in Dataset name
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
misi
Beginner


Joined: 14 Apr 2004
Posts: 13
Topics: 10

PostPosted: Tue Apr 20, 2004 4:41 am    Post subject: Current date and time in Dataset name Reply with quote

I need to have the current date and time as a part of my dataset. can any body help me?

I want USERID.YYYYMMDD.HHMMSS

misi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 20, 2004 5:05 am    Post subject: Reply with quote

Misi,

You cannot define the dataset with one of the qualifier starting with a numeric. In your requirement you wanted userid.yyyymmdd.hhmmss. You need to have alphabet as a prefix in qualifier.

So is it okay if the dataset looks like this?
Code:

userid.Dyymmdd.Thhmmss


I used D to signify the date and T to signify the time.

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Apr 20, 2004 5:13 am    Post subject: Reply with quote

Based on Kolusu's Note:
Code:

//*
//STEP0001 EXEC PGM=EZACFSM1
//SYSIN DD DATA,DLM=@@
//SUPERK JOB (T,67423,000),'SUPERK',CLASS=T,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*
//STEP0001 EXEC PGM=IEFBR14
//FILE1 DD DSN=&USERID..D&LYR2&LMON&LDAY..T&HR&MIN&SEC,
// DISP=(MOD,DELETE,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(0,0),RLSE)
//*
//STEP0002 EXEC PGM=ICEGENER
//SYSUT1 DD DUMMY
//SYSUT2 DD DSN,
// DISP=(,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(100,100),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
@@
//SYSOUT DD SYSOUT=(A,INTRDR)
//*

The problem is - there are just way too many different ways to do this.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 20, 2004 5:39 am    Post subject: Reply with quote

Superk,

A couple of corrections. In your step0001 you used &userid, but i guess you actually meant &Sysuid. Also in step0002 you forgot the name of the dataset in DSN field.

Also I am not sure why you used to 2 steps when it can be just done in one step.

Code:

//STEP0100 EXEC PGM=EZACFSM1                     
//SYSOUT   DD SYSOUT=(*,INTRDR)                   
//SYSIN    DD DATA,DLM=@@                         
//USERIDA  JOB (,1722),                           
//             'KOLUSU',                       
//             CLASS=A,                           
//             MSGCLASS=Y,                       
//             MSGLEVEL=(1,1),                   
//             NOTIFY=&SYSUID                     
//STEP0100 EXEC PGM=IEFBR14                       
//FILE01   DD DSN=&SYSUID..D&LYYMMDD..T&LHHMMSS, 
//            DISP=(NEW,CATLG,DELETE),           
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(10,10),RLSE),             
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)   
@@                                               



Alternatively you can use DFSORT to achieve the same results.

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                               
//SORTIN    DD *                                                       
DUMMY RECORD                                                           
//SORTOUT   DD SYSOUT=(*,INTRDR)                                       
//SYSIN     DD *                                                       
  SORT FIELDS=COPY                                                     
  INREC FIELDS=(DATE1,X,TIME)                                           
  OUTFIL OUTREC=(C'//USERIDZ JOB ',X'7D',C'CREATE DSN',X'7D',             
                 C',CLASS=A,',/,                                           
                 C'//',13X,C'MSGCLASS=Y,MSGLEVEL=(1,1),',/,                 
                 C'//',13X,C'NOTIFY=&SYSUID',/,                             
                 C'//*',/,                                                 
                 C'//STEP0100 EXEC PGM=IEFBR14',/,                         
                 C'//FILE1    DD DSN=&SYSUID.',C'D',3,6,               
                 C'.T',10,2,13,2,16,2,C',',/,                               
                 C'//            DISP=(NEW,CATLG,DELETE),',/,               
                 C'//            UNIT=SYSDA,',/,                           
                 C'//            SPACE=(CYL,(10,10),RLSE),',/,               
                 C'//            DCB=(LRECL=080,RECFM=FB,BLKSIZE=0)',/,     
                 C'//*',80:X)                                               
/*                                                                         


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Apr 20, 2004 7:18 am    Post subject: Reply with quote

Sorry - I had just got up and hadn't had my coffee yet.

Personally, I prefer to use normal datasets throughout the job, and only at the end, copy the working dataset (with DISP=(SHR,DELETE)) into the dataset with the DATE/TIME fields.

It's always hard to tell from these posts if the poster requires that the dataset name be carried forward for multiple steps of the job (which is where I recommend using either the Job Scheduler or setting a variable using a SET command), or if they just need an output dataset and the end of the job with the DATE/TIME (I call this a DATE/TIME stamp).
Back to top
View user's profile Send private message
misi
Beginner


Joined: 14 Apr 2004
Posts: 13
Topics: 10

PostPosted: Tue Apr 20, 2004 10:40 am    Post subject: Reply with quote

Thanks superk and kolusu

We need the 4 digit year part in our dataset name. Is it possible.

Thanks

misi
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue Apr 20, 2004 10:46 am    Post subject: Reply with quote

I would go with a Julian Date then:

USERID.DYYYYDDD.THHMMSS
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue Apr 20, 2004 11:23 am    Post subject: Reply with quote

If you want 4 digit year then you are exceeding the length of 8 for each qualifier. so another option is to split the name into individual qualifiers.

Code:

USERID.YEARyyyy.MONmm.DAYdd.HHMMSS


Now you can simulate the above shown jobs to your requirement.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Apr 22, 2004 7:25 pm    Post subject: Reply with quote

Why don't you go for a dataset name in Roman numerals?

DATASET.MMIV.IV.XXIII

LMAO... Laughing
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
modak
Beginner


Joined: 09 Apr 2004
Posts: 14
Topics: 3

PostPosted: Fri Apr 23, 2004 12:50 am    Post subject: Reply with quote

Kolusu,

What does EZACFSM1 do. is it a dummy utility like IEFBR14.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Sun Apr 25, 2004 11:22 pm    Post subject: Reply with quote

Killjoy. Sad

Just write some logic to call the dataset DATASET.MIDNIGHT
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Sure116
Beginner


Joined: 25 May 2004
Posts: 2
Topics: 1

PostPosted: Tue May 25, 2004 8:49 am    Post subject: Reply with quote

kolusu,

hi,
I am trying ur jcl the step0100 is repeated twice
Can u explain me in breif whether one has to be in Execjcl & other in proc some thing like that
Code:

//STEP0100 EXEC PGM=EZACFSM1                     
//SYSOUT   DD SYSOUT=(*,INTRDR)                   
//SYSIN    DD DATA,DLM=@@                         
//USERIDA  JOB (,1722),                           
//             'KOLUSU',                       
//             CLASS=A,                           
//             MSGCLASS=Y,                       
//             MSGLEVEL=(1,1),                   
//             NOTIFY=&SYSUID                     
//STEP0100 EXEC PGM=IEFBR14                       
//FILE01   DD DSN=&SYSUID..D&LYYMMDD..T&LHHMMSS, 
//            DISP=(NEW,CATLG,DELETE),           
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(10,10),RLSE),             
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)   
@@

_________________
Suresh Gummalla
Back to top
View user's profile Send private message Send e-mail
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Tue May 25, 2004 10:53 am    Post subject: Reply with quote

Sure116, STEP0100 is coded only once PER JOB. It is probably a required standard of the coder of the sample JCL that every job start with STEP0100.

Maybe it's me, but I don't understand the second part of the question at all.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Tue May 25, 2004 11:58 am    Post subject: Reply with quote

Suresh,

The above JCL is creating another JCL on the fly and submitting to Intrdr. It is just my habbit that I start all my jobsteps as STEP0100, STEP0200... so on.

Change the SYSOUT statement in the posted JCL to the following.

Code:

//SYSOUT DD SYSOUT=*


Now submit the job with this change and now check the sysout of the JOB. YOu will find another JCL with all the system symbols translated.

With INTRDR (Internal Reader), the job is submitted and the dataset is created with date and time.

Search this forum for INTRDR and you will find a detailed explanation.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu May 27, 2004 8:18 am    Post subject: Reply with quote

Just for clarification, it's worth noting that the &SYSUID symbolic is not resolved by EZACFSM1 but rather as the job is actually sent thru INTRDR.

Regards,
Bill
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group