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

Document ID : KB000055354
Last Modified Date : 14/02/2018
Show Technical Document Details

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.