345 pts.
 As400 subdirectory
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

Answer Wiki:
If you the DIR /ABC/XYZ exists on your system and you run command WRKLNK OBJ(ABC/XYZ) the directory will display on your screen. If you want to know the contends of /XYZ, you just need to use option 5=Display. I think I may not be understaning the question properly. Can you be more specific on what you want to accomplish.
Last Wiki Answer Submitted:  April 19, 2012  1:50 pm  by  CharlieBrowne   32,805 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,805 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

endpgm

But 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

 107,845 pts.

 

Thank you for u r good suggisations

 345 pts.