Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

All sort of Mainframes Interview Questions.
Post Reply
Harsh Deol
New Member
Posts: 9
Joined: Sat Nov 22, 2014 12:32 pm

Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Harsh Deol »

Hi,

Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

I'm not sure how to do it? Had it been a VSAM dataset I could have used DELETE statement but can we use that with a sequential files also?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Robert Sample »

For a sequential data set, one approach would be to use IEBGENER with DD DUMMY input and output being the data set with DISP=OLD specified.
Harsh Deol
New Member
Posts: 9
Joined: Sat Nov 22, 2014 12:32 pm

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Harsh Deol »

Hi Robert,

Thanks. Will DISP=SHR made a difference?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Robert Sample »

DISP=SHR may make a difference. DISP=OLD requires your job to have exclusive access to the data set. DISP=SHR says that you will share access. With other jobs / TSO users accessing the data set while you're trying to delete all records, you're not likely to delete the records. If no other jobs / TSO users are accessing the data set while your job is running, then DISP=SHR will work like DISP=OLD.
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Taran Bhatia »

What can be the practical use of this knowledge in the actual Job? Can there be a situation where we need to implement a solution like this?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Robert Sample »

This situation does occur in production environments. It is not that common but it does happen.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Anuj Dhawan »

This post might also be of interest: https://zmainframes.com/zlog/delete-con ... mainframe/
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Taran Bhatia
Registered Member
Posts: 15
Joined: Wed Oct 22, 2014 8:51 am

Re: Is there a possibility to delete the ps file records thru JCL and make the ps file a fresh for code availability??

Post by Taran Bhatia »

Thaks Robert and Anuj.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”