in as/400 we are using directory
now i create one directory like ABC, later i create one more sub directory like XYZ
It is looking Like ABC/XYZ
i want to find XYZ sub directory is there are not , is there any comands to find subdirectory
i use WRKLNK OBJ(ABC/XYZ) but i will open the path, now i want to find out that subdirectory exiting or not
Can you give examples
Software/Hardware used:
software
ASKED:
April 19, 2012 7:00 AM
UPDATED:
April 26, 2012 11:56 AM
There are various ways. One fairly easy way is the access() API. It can be used in any ILE language. Here’s a trivial example in CL:
pgm dcl &fname *char 512 dcl &amode *int dcl &F_OK *int value( 0 ) dcl &x00 *char 1 value( x'00' ) dcl &rc *int value( 0 ) chgvar &amode &F_OK chgvar &fname ( + 'ABC/XYZ' *cat + &x00 + ) callprc 'access' ( + &fname + ( &amode *byval ) + ) + rtnval( &rc ) /* Note: &rc *eq x'00000000'=0 on success; x'FFFFFFFF'=-1 on fail... */ if ( &rc *eq 0 ) + sndpgmmsg msgid( CPF9898 ) msgf( QCPFMSG ) + msgdta( 'The IFS object exists' ) else + sndpgmmsg msgid( CPF9898 ) msgf( QCPFMSG ) + msgdta( 'The IFS object does NOT exist' ) return endpgmBut it might not be quite as easy as getting an indication of existence.
What do you need it for? How will you need to use it? Other steps might be necessary.
Tom
Thank you for u r good suggisations