Using PCL how can I check if a member in a PDS exists?
search cancel

Using PCL how can I check if a member in a PDS exists?

book

Article ID: 55354

calendar_today

Updated On:

Products

Alchemist TPX - Session Management Vman Session Management for z/OS

Issue/Introduction

Here is a example of PCL that can check to see if a file has members.

Example:

// SET DBRMLIB = 'CYBRAR1.INSTALL'
// SET ENAME = 'EMPTY'
// ALLOCATE DBRMLIBR,
// DSN=&DBRMLIB,DISP=SHR
//*
// OPEN DBRMLIBR,INPUT
// OPEN DBRMLIBR,MEMBER,NAME='&ENAME'
//*
// READ DBRMLIBR,NEXT
// IF (DBRMLIBR_STATUS.EOF INCLUDES 'FALSE')
// DISPLAY 'RECORDS ARE IN FILE'
// ELSE
// DISPLAY 'NO RECORDS ARE IN THE FILE'
// ENDIF
//*
// FREE DBRMLIBR
//*

...

This Frequently Asked Question applies to all supported releases of ESP Alchemist.

Environment

Release:
Component: ALCMST