I am calling API QSYRUSRI to get the user profile Home Directory, but the
structure that the info comes back into has the directory name formatted as
CCSID 1200.

You can use the iconv() API to translate the result. There should be examples of calling the iconv() API in the archives, I'm pretty sure I've posted some before. If you can't find any, let me know.


Personally, I'd use the getpwnam() API to get the home directory. It's just easier to use. Here's an example of an RPG program that's intended to be called by CL to get a user's home directory:

     H DFTACTGRP(*NO)

     D passwd          DS                  qualified
     D                                     BASED(Template)
     D  pw_name                        *
     D  pw_uid                       10U 0
     D  pw_gid                       10U 0
     D  pw_dir                         *
     D  pw_shell                       *

     D getpwnam        PR              *   ExtProc('getpwnam')
     D   name                          *   Value options(*string)

     D p_info          s               *
     D info            ds                  likeds(passwd)
     D                                     based(p_info)

     D peUser          s             10A
     D peHomeDir       s            256A

     C     *entry        plist
     c                   parm                    peUser
     c                   parm                    peHomeDir

     c                   eval      p_info = getpwnam(%trimr(peUser))
     c                   if        p_info = *NULL
     c*** error occurred. Check errno to find out what went wrong.
     c                   endif

     c                   eval      peHomedir = %str(info.pw_dir)
     c                   return



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.