Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Dynamic Access I/p Dataset whose name as Timestamp value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 26
Location: Pune

PostPosted: Fri May 02, 2008 9:15 pm    Post subject: Dynamic Access I/p Dataset whose name as Timestamp value
Reply with quote

Hi,
I have a monthly Audit file whose naming convention is like

Code:
AUDIT.Y2008.M05.D02


which is of the format AUDIT.Yyyyy.Mmm.Ddd (Basically the date of the
day when the file is created and the program needs to be executed).

This audit file is generated every month which acts as an I/P to a certain program. Is there a way to read this file in the run JCL without making changes to the file name everytime the program is run ?

Thanks and Regards,
Puspojit
Back to top
View user's profile Send private message
References
PostPosted: Fri May 02, 2008 9:15 pm    Post subject: Re: Dynamic Access I/p Dataset whose name as Timestamp value Reply with quote

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 2921
Location: Charlotte,NC USA

PostPosted: Fri May 02, 2008 10:35 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

Well, let's think this process out a bit. First of all, how is the job and/or program going to know what values to use for the variable data:

AUDIT.Yyyyy.Mmm.Ddd

Or, to consider, how is the actual dataset name going to be conveyed to the job and/or program? Are you running some sort of step where you LISTCAT the high-level qualifier to determine the rest of the dataset name?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 6031
Location: 221 B Baker St

PostPosted: Fri May 02, 2008 10:43 pm    Post subject:
Reply with quote

Hello,

Quote:
First of all, how is the job and/or program going to know what values to use for the variable data:
How did the process that created the dataset know which values to use?
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 26
Location: Pune

PostPosted: Mon May 05, 2008 7:56 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

Hi SuperK and Dick,

Thanfully,The requirements have changed a bit
I will explain the requirement......
A dataset will be created in the UNIX enviroment and through shell script,
it will be exported to Mainframe....The name of this dataset is fixed,
say,AUDIT.BATCH.FILE
This dataset shall contain a file name with names such as AUDIT.Y2008.M05.D02 which will change every month accordingly.

My requirement is to read the first file and extract the file name it contains within......Then use this second file as input to my programs.

Could you please suggest me a way to do this?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 2921
Location: Charlotte,NC USA

PostPosted: Mon May 05, 2008 8:07 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

The best way, in my opinion, from a Production Support point-of-view?

Make sure that 'AUDIT.BATCH.FILE' is a PDS and that a constant member, let's say AUDIT, is used.

AUDIT should contain either:

A. A valid SET statement, i.e. // SET FILENAME=AUDIT.Y2008.M05.D02

or

B. A valid DD statement, i.e. //INPUT DD DSN=AUDIT.Y2008.M05.D02,DISP=SHR

and then INCLUDE the member AUDIT in your job at an appropriate location.

Otherwise, there's dynamic allocation from the program, copying the variable dataset name to a constant name, revamping the process entirely, creating dynamic JCL, etc., blah, blah, blah, anyone of which have been discussed here already.
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 26
Location: Pune

PostPosted: Mon May 05, 2008 8:58 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

Hi Kevin ,

I just got confirmed from the UNIX team....the 'AUDIT.BATCH.FILE' will be a simple PS and it shall contain the file name AUDIT.Y2008.M05.D02 as a single record in it.

I have to pick up this record and place it as an input file to my program....I just saw your previous post in http://www.ibmmainframes.com/about25906.html
But I guess you were referring to PDS which is not my case over here.

Could you please advise any other alternatives ?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 2921
Location: Charlotte,NC USA

PostPosted: Mon May 05, 2008 10:23 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

I suppose the next best thing might be to copy the dataset to a temp dataset and use the temp dataset for the processing:

Code:

//STEP1    EXEC PGM=SORT                                           
//SORTIN   DD   DSN=AUDIT.BATCH.FILE,DISP=SHR
//SORTOUT  DD   DSN=&&T1,DISP=(,PASS),UNIT=VIO,                     
//         SPACE=(TRK,(1,1))                                       
//SYSOUT   DD   SYSOUT=*                                           
//SYSIN    DD   *                                                   
  OPTION COPY,STOPAFT=1                                             
  OUTREC FIELDS=(1:C'  REPRO IDS',                                 
    1,44,SQZ=(SHIFT=LEFT,LEAD=C'(',TRAIL=C') OFILE(OUT)'),80:X)     
/*                                                                 
//*                                                                 
//STEP2    EXEC PGM=IDCAMS                                         
//OUT      DD   DSN=&&T2,DISP=(,PASS),UNIT=VIO,                     
//         SPACE=(TRK,(1,1))                                       
//SYSPRINT DD   SYSOUT=*                                           
//SYSIN    DD   DSN=&&T1,DISP=(OLD,DELETE)                         
//*                                                                 
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 26
Location: Pune

PostPosted: Tue May 06, 2008 12:21 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

Hi Kevin,

Thanks a lot .... your logic worked perfectly fine.
Just needed to know why is this the "Next" best thing and not the best icon_question.gif


Thanks once again for your Inputs,
Puspojit
Back to top
View user's profile Send private message
Puspojit

New User


Joined: 10 Mar 2008
Posts: 26
Location: Pune

PostPosted: Wed May 07, 2008 8:11 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

Hi ,

Just an additional requirement in the Job......
How do I delete the monthly file after processing it?

I know its a bit weird requirement but I am required to do it.
Code:
 AUDIT.Y2008.M05.D02

This file is to be deleted
This file is contained as a record in the file
Code:
AUDIT.BATCH.FILE


Is there any utility where I have to supply the file to be deleted within SYSIN....In that case my task can be solved.

Looking forward for your Ideas..
Thanks and Regards,
Puspojit
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 2921
Location: Charlotte,NC USA

PostPosted: Wed May 07, 2008 8:41 pm    Post subject: Reply to: Dynamic Access I/p Dataset whose name as Timestam
Reply with quote

IDCAMS DELETE.
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1124
Location: Mumbai, India

PostPosted: Thu May 08, 2008 5:47 am    Post subject:
Reply with quote

Quote:
Just needed to know why is this the "Next" best thing and not the best
Because "this" was the "next" thought. Both were best but "this " was better than the logical previous so "Next" Best... icon_smile.gif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1