View previous topic :: View next topic
|
Author |
Message |
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Hi,
We are doing our testing and and some of them having this kind of step:
STEP
Code: |
//STEP EXEC PGM=IDCAMS
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//INF DD DSN=HIQUAL.SEQDS,DISP=SHR
//OUTF DD DSN=HIQUAL.VSAM,DISP=SHR
//SYSIN DD DSN=PARMLIB(PARM),DISP=SHR
|
PARM
Code: |
REPRO INFILE(INF) OUTFILE(OUTF) REUSE |
our problem is, the OUTF have NOREUSE attribute.
what we do is to put an ALTER before the REPRO. (We do it in-stream)
Code: |
ALTER HIQUAL.VSAM REUSE
REPRO INFILE(INF) OUTFILE(OUTF) REUSE |
But I'm looking for a way to have something like this so the parm can handle other vsam files as well. Something like the code below to handle any dataset name for OUTF.
Code: |
ALTER OUTF REUSE
REPRO INFILE(INF) OUTFILE(OUTF) REUSE |
I have checked this as reference but can't find anything about like this. But I'm hoping there could be a way for it.
link |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What do you think about using REUSE at define time of your output vsam dataset? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Or doing a delete/define instead of doing an ALTER |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
you should be able to do it with a TSO batch like:
// SET DSN=whatever
//*
//ALTER EXEC PGM=IKJEFT1B,
// PARM='ALTER ''&DSN'' REUSE'
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*
//REPRO EXEC PGM=IDCAMS
rest of your job |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
From the link you posted, entryname is a required parameter and it should contain the name of the dataset. There is no way we can have a ddname as an entryname.
Even if 'somehow' you were able to achieve anything similar to what you have mentioned, you have to keep in mind that the ALTER will be done everytime when that control card is used whether it's needed or not. This control card will be beneficial only for the first run since the next runs will already have the files as Reusable. That would mean that an ALTER will be done on Reusable files in the subsequent runs (which is completely unnecessary).
I believe that you should do a delete/define as mentioned by Peter.
. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
I think, TS just wants this work around for testing purpose ONLY as files are in NOREUSE state and TS may wants to keep two jobs one with Willy's trick and then subsequent one's without that. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
*Not sure if he wants 2 jobs.
Even for testing purpose, It doesn't make sense to do an ALTER when it is not needed.
Testing means running the job multiple times BUT the dataset(s) needs to be Altered only Once. Therefore it makes more sense to run a delete/define one time only to make the file Reusable.
Per me, Altering the file everytime a job is run (specifically in this particular case) is not needed.
. |
|
Back to top |
|
|
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Thank you for your reply PeterHolland. What we did now is to put the REUSE inside the vsam definition. |
|
Back to top |
|
|
boyti ko
New User
Joined: 03 Nov 2014 Posts: 78 Location: Malaysia
|
|
|
|
Quote: |
Thank you for your reply PeterHolland. What we did now is to put the REUSE inside the vsam definition. |
I actually supposedly reply that yesterday. I just managed to submit it today and saw that there are others who answered to my question. Thanks to you all.
What we did is to del/def the file with the REUSE on it. But going forward, we're just having a research if there's any other way to do it that time using minimal change only. For example, if there's somehow a code similar to this,
Code: |
ALTER OUTF REUSE
REPRO INFILE(INF) OUTFILE(OUTF) REUSE |
then we could just edit that parm, add that 1 line and all is good. Then we can handle the REUSE on the del/def later. It's nice to see other answer like Willy that is completely different from what we used to do. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Every time your datasetname changes, you need to change the parm in Willy's solution. So you can as easily change the datasetname in the delete/define. There is no difference, beside the extra TSO step.
You don't even have to use REUSE because you are deleting/defining. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
maybe I should have said that the purpose of my sample was to externalize the clustername. with z/OS 2.1 and onwards you can use symbols instead. |
|
Back to top |
|
|
Abid Hasan
New User
Joined: 25 Mar 2013 Posts: 88 Location: India
|
|
|
|
Fwiw, another solution can be building the IDCAMS ALTER control-card through REXX or another tool, I'd a requirement a while back (to delete datasets), I ended up coding a simple DFSORT step, sample given below (since I was working with a large number of datasets, and there was possibility of duplicates hence the SUM FIELDS):
Code: |
//SORTIN DD DSN=<DSN CONTAINING DATASET NAMES ON WHICH ACTIVITY IS TO BE DONE>,DISP=SHR
//SORTOUT DD DSN=<A PDS MEMBER OR PS FILE WHERE THE O/P CAN BE STORED>,DISP=SHR
//SORTMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,55,CH,A)
OUTREC FIELDS=(1:C'DELETE ',8:1,55,63:C' PURGE',69:12X'40')
SUM FIELDS=NONE
/*
|
and then have an IDCAMS step as below:
Code: |
//STEP002 EXEC PGM=IDCAMS,COND=(0,NE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSDUMP DD SYSOUT=*
//SYSIN DD DSN==<A PDS MEMBER OR PS FILE WHERE THE O/P CAN BE STORED>,DISP=SHR
|
The DFSORT control card will do the trick for the TS, with a few changes to it.
Hth. |
|
Back to top |
|
|
|