IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to alter a vsam using its ddname as entryname


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Thu Nov 19, 2015 10:49 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 19, 2015 12:10 pm
Reply with quote

What do you think about using REUSE at define time of your output vsam dataset?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 19, 2015 1:42 pm
Reply with quote

Or doing a delete/define instead of doing an ALTER
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Fri Nov 20, 2015 12:55 am
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Nov 20, 2015 3:17 am
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Nov 20, 2015 3:39 am
Reply with quote

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
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Nov 20, 2015 3:57 am
Reply with quote

*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
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Fri Nov 20, 2015 11:32 am
Reply with quote

Thank you for your reply PeterHolland. What we did now is to put the REUSE inside the vsam definition.
Back to top
View user's profile Send private message
boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Fri Nov 20, 2015 12:43 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Nov 20, 2015 2:59 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sat Nov 21, 2015 7:41 pm
Reply with quote

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
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Tue Nov 24, 2015 10:08 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top