Skip to content

Instantly share code, notes, and snippets.

@ibmiiste
Last active August 29, 2015 14:27
Show Gist options
  • Save ibmiiste/c2f4d94f5837ac77ef3d to your computer and use it in GitHub Desktop.
Save ibmiiste/c2f4d94f5837ac77ef3d to your computer and use it in GitHub Desktop.
* ====================================================================
* Test existence objet
* ====================================================================
PExists B
D PI 1N
D Obj 20A CONST
D ObjType 10A CONST
*
/COPY API_OBJ
D ObjL S 20A
D Objd DS likeDS(ObjD0100)
D ErrDS DS likeDS(ERRAPI)
/free
ObjL = Obj;
if %Subst( ObjL : 11 : 10) = *BLANK;
%Subst( ObjL : 11 : 10) = '*LIBL';
endif;
RtvObj( Objd : %len(ObjD) : 'OBJD0100' : Objl : ObjType : ErrDS);
if ErrDS.ErrRtn > 0;
return *OFF;
endif;
return *ON;
/end-Free
PExists E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment