This is certainly getting complicated.  How about we simplify a little bit?
If the intention is to keep the location the user entered indefinitely,
create a file with fields for user and location.  The create a service
program with procedures that will update and retrieve this information.

I'm getting confused. I've only been halfway paying attention to this thread, but now I'm worried that I missed a detail. It seems to me that he just wanted to have a data area that's named for the userid, and that this data area would contain some info about the user's location.

Isn't that extremely easy to do?

     D                SDS
     D  UserID               358    367A

     D QCMDEXC         PR                  ExtPgm('QCMDEXC')
     D   cmd                      32702A   const options(*varsize)
     D   len                         15P 5 const

     D cmd             s            200A   varying
     D UserDtaAra      s             21A

     D Location        ds                  dtaara(*Var:UserDtaAra)
     D   part1                 1      2A
     D   part2                 3      4A
     D   part3                 5     10A

      /free
          // ------------------------------------------------
          // Data areas are in the DTAARALIB library, and
          //  have the same name as the userid.
          // ------------------------------------------------

          UserDtaAra = 'DTAARALIB/' + UserID;

          // ------------------------------------------------
          // Does the data area exist?  If not, create it.
          // ------------------------------------------------

          cmd = 'CHKOBJ OBJ(' + %trim(UserDtaAra) + ') OBJTYPE(*DTAARA)';
          monitor;
             QCMDEXC(cmd:%len(cmd));
          on-error;
             cmd = 'CRTDTAARA DTAARA(' +%trim(UserDtaAra) + ') ' +
                             'TYPE(*CHAR) LEN(10)';
             QCMDEXC(cmd:%len(cmd));
          endmon;

          // ------------------------------------------------
          // The IN op-code reads a data area:
          // ------------------------------------------------

          in *lock Location;

          // ------------------------------------------------
          // The OUT op-code updates a data area:
          // ------------------------------------------------

          Part1 = 'AA';       // these are just test values.
          Part2 = 'BB';
          Part3 = 'CCCCCC';
          out Location;

          *inlr = *on;
      /end-free

Is there something else that I'm missing that would make this complicated? Like I said, I've only been halfway paying attention, so it's certainly possible that he needs to do something else with it that'll make it more difficult.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.