Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to alter a vsam using its ddname as entryname

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how to alter a vsam using its ddname as entryname
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 19, 2015 12:10 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Nov 19, 2015 1:42 pm    Post subject:
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

New User


Joined: 01 Sep 2015
Posts: 94
Location: Switzerland

PostPosted: Fri Nov 20, 2015 12:55 am    Post subject:
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: 331
Location: USA

PostPosted: Fri Nov 20, 2015 3:17 am    Post subject: Reply to: how to alter a vsam using its ddname as entryname
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Fri Nov 20, 2015 3:39 am    Post subject:
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: 331
Location: USA

PostPosted: Fri Nov 20, 2015 3:57 am    Post subject: Reply to: how to alter a vsam using its ddname as entryname
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    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Nov 20, 2015 2:59 pm    Post subject:
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

New User


Joined: 01 Sep 2015
Posts: 94
Location: Switzerland

PostPosted: Sat Nov 21, 2015 7:41 pm    Post subject:
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: 65
Location: India

PostPosted: Tue Nov 24, 2015 10:08 am    Post subject: Reply to: how to alter a vsam using its ddname as entryname
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
No new posts output DDname JESMSGLG job during exe... italo_pm TSO/ISPF 16 Tue Jun 21, 2016 11:13 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us