Impromptu messages - IBM AS400

This is a discussion on Impromptu messages - IBM AS400 ; I'm trying to figure out how to send impromptu interactive messages like I used to do in OCL. My normal method (back in my S/36 days) was: * Display a few blank lines so the user could tell this was ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Impromptu messages

  1. Impromptu messages

    I'm trying to figure out how to send impromptu interactive messages
    like I used to do in OCL.

    My normal method (back in my S/36 days) was:
    * Display a few blank lines so the user could tell this was a new set
    of impromptu messages.
    * Display a few message lines as needed
    * Prompt for the reply on the last message line

    Like so:

    // * ' '
    // * ' '
    // * ' '
    // * 'Message text that would be no more than 80 characters'
    // * 'If necessary, I would go to a second line.'
    // * 'Sometimes even a third line.'
    // * 'And then prompt for reply' EVALUATE P1=?R?

    I tried to do it with SNDUSRMSG, but you have to press enter for each
    message even when it's a *INFO message. (Or should I use SNDPGMMSG or
    SNDMSG?) I have used my CL books by Jim Sloan as well as Ted Holt/
    Ernie Malaga and some trial/error but still can't seem to figure it
    out.

    Ideally, it would also use VALUES(X Y Z) DFT(X) MSGRPY(&REPLY)

    The other option is to create a DSPF and do SNDRCVF but I prefer not
    to create a source member for a procedure that is run very
    infrequently.

    TIA for any help anyone can give.

    P.S. Hopefully my memory of OCL is correct or close to correct!


  2. Re: Impromptu messages

    Chipper,
    Here is a snipette from a CL. Try it out and experiment with it.



    SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +
    MSGDTA('Quarterly Employee Report +
    processing is complete.') TOPGMQ(*EXT) +
    MSGTYPE(*STATUS)

    peace
    that 1 guy


  3. Re: Impromptu messages

    Chipper Miller wrote:
    > I'm trying to figure out how to send impromptu interactive messages
    > like I used to do in OCL.
    >
    > My normal method (back in my S/36 days) was:
    > * Display a few blank lines so the user could tell this was a new set
    > of impromptu messages.
    > * Display a few message lines as needed
    > * Prompt for the reply on the last message line
    >
    > Like so:
    >
    > // * ' '
    > // * ' '
    > // * ' '
    > // * 'Message text that would be no more than 80 characters'
    > // * 'If necessary, I would go to a second line.'
    > // * 'Sometimes even a third line.'
    > // * 'And then prompt for reply' EVALUATE P1=?R?
    >
    > I tried to do it with SNDUSRMSG, but you have to press enter for each
    > message even when it's a *INFO message. (Or should I use SNDPGMMSG or
    > SNDMSG?) I have used my CL books by Jim Sloan as well as Ted Holt/
    > Ernie Malaga and some trial/error but still can't seem to figure it
    > out.
    >
    > Ideally, it would also use VALUES(X Y Z) DFT(X) MSGRPY(&REPLY)
    >
    > The other option is to create a DSPF and do SNDRCVF but I prefer not
    > to create a source member for a procedure that is run very
    > infrequently.
    >
    > TIA for any help anyone can give.
    >
    > P.S. Hopefully my memory of OCL is correct or close to correct!
    >


    You are nearly there. You dont need multiple messages for each line - a
    SNDUSRMSG allows 512 characters for the message. The message will then
    be wrapped when it is displayed. Try

    SNDUSRMSG MSG('** THIS IS 512 CHARACTERS OF TEXT hdl ahsdh as
    shdlkjahs dlkjahsdhasdkj haslkd haklshd ljkasd
    hkahdljkahdkhadjkha ksd hakljd hklajhdkljahsdk
    jhaskd haklsdh kjahdahsdkahsdkjhaskjdhakljsdh
    ash dlkahskdjhaskjdh klajs hdjklashd ksah dklj
    ashdkashd klashd kljashdljkash dkjlas dkj jk d
    kjd jksadh ajsdh jklasd hljksd hklsjd hkasjdh
    kasj dhkjadh kjadhkas hdkash dkja hdlkha dklha
    sdklha sdkh askld haklsdh kas hdkas hdkas hdk
    a hdkjhd kas dhkashdkashdkjah dkjashd jakdh a
    hdakd haksdh aksdh kashd kahd kashdkas hdkahsd
    kjh ')
    VALUES('X' 'Y' 'Z')
    DFT('X')
    MSGTYPE(*INQ)
    MSGRPY(&REPLY)

    HTH

    GB

  4. Re: Impromptu messages

    Hi GB --

    Thanks for the input: There's one detail I forgot to mention. I often
    like to give each option a "line" to make it easier for the users to
    digest. Such as:

    Take option X to do something
    Take option Y to do something else
    Take option Z to do another thing

    I'll keep playing with it some more.



    > You are nearly there. You dont need multiple messages for each line - a
    > SNDUSRMSG allows 512 characters for the message. The message will then
    > be wrapped when it is displayed. Try
    >
    > SNDUSRMSG MSG('** THIS IS 512 CHARACTERS OF TEXT hdl ahsdh as
    > shdlkjahs dlkjahsdhasdkj haslkd haklshd ljkasd
    > hkahdljkahdkhadjkha ksd hakljd hklajhdkljahsdk
    > jhaskd haklsdh kjahdahsdkahsdkjhaskjdhakljsdh
    > ash dlkahskdjhaskjdh klajs hdjklashd ksah dklj
    > ashdkashd klashd kljashdljkash dkjlas dkj jk d
    > kjd jksadh ajsdh jklasd hljksd hklsjd hkasjdh
    > kasj dhkjadh kjadhkas hdkash dkja hdlkha dklha
    > sdklha sdkh askld haklsdh kas hdkas hdkas hdk
    > a hdkjhd kas dhkashdkashdkjah dkjashd jakdh a
    > hdakd haksdh aksdh kashd kahd kashdkas hdkahsd
    > kjh ')
    > VALUES('X' 'Y' 'Z')
    > DFT('X')
    > MSGTYPE(*INQ)
    > MSGRPY(&REPLY)
    >
    > HTH
    >
    > GB- Hide quoted text -
    >



  5. Re: Impromptu messages

    Chipper Miller wrote:
    > Hi GB --
    >
    > Thanks for the input: There's one detail I forgot to mention. I often
    > like to give each option a "line" to make it easier for the users to
    > digest. Such as:
    >
    > Take option X to do something
    > Take option Y to do something else
    > Take option Z to do another thing
    >
    > I'll keep playing with it some more.


    What a kind and considerate programmer! I would just expect the users to
    get used to the "new format" - but you could experiment with putting
    blanks into the message to cause it to wrap at a different point and you
    will possibly get what you want - good luck.

    GB

+ Reply to Thread