|
|
| Author |
Message |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
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 |
|
 |
References
|
Posted: Fri May 02, 2008 9:15 pm Post subject: Re: Dynamic Access I/p Dataset whose name as Timestamp value |
 |
|
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3013 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6931 Location: 221 B Baker St
|
|
|
|
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 |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3013 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3013 Location: Charlotte,NC USA
|
|
|
|
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 |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
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
Thanks once again for your Inputs,
Puspojit |
|
| Back to top |
|
 |
Puspojit
New User
Joined: 10 Mar 2008 Posts: 35 Location: Pune
|
|
|
|
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
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 |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 3013 Location: Charlotte,NC USA
|
|
|
|
| IDCAMS DELETE. |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1345 Location: Mumbai, India
|
|
|
|
| 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...  |
|
| Back to top |
|
 |
|
|