IBM Security Z Security

Security for Z

Join this online user group to communicate across Z Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Sending Email with long message but Date and Page number interfering with message.

    Posted Thu December 21, 2023 04:50 PM

    I am trying to draft an email with a long message in a Carla report  the following:  Note the Carla query is not the important thing here, although I am using TYPE=RACF_ACCESS. My main concern is my long message in the email having the Date and Page Number in the middle of it.  

    OPTION smtpclass=B smtpwriter=CSSMTP smtpatsign=@,                
     mt=`&mailto`,                                                    
     from=`&mailfrom`,                                                
     mfs=3                                                            
    newlist type=RACF_ACCESS,                                         
    tt='The following message is very long so I used a TopTitle and', 
    t='Title and SubTitle. I am sending this report in an email',     
    st='Undefined user ID in 1st qualifier of profile'                
     select class=surrogat profile=USERID.SUBMIT                     
      sortlist profile class    

    When I receive the email the Date and Page number are finding their way right in the middle of my message.  Is there a way to keep the TopTitle, Title and SubTitle but get rid of the Date and Page Number in the report?

    Below is what my email looks like, notice the Date and Page Number. 

    The following message is very long so I used a TopTitle and  21 Dec 2023 15:31                                             page   
    1
    Title and SubTitle. I am sending this report in an email
    Undefined user ID in 1st qualifier of profile
     
    This also happens if I use a short TopTitle message, the number of the page wraps to the 2nd line in the email.
    Alert  21 Dec 2023 15:47                                                                                                   page    
    1
    Title and SubTitle. I am sending this report in an email,            More text to write can I do this with just a title.
    Undefined user ID in 1st qualifier of profile
    Profile                                      Class
    USERIDA.SUBMIT                               SURROGAT

                       



    ------------------------------
    Scott Lahner
    ------------------------------


  • 2.  RE: Sending Email with long message but Date and Page number interfering with message.

    Posted Fri December 22, 2023 07:04 AM

    Hi Scott,

    I believe I have heard a similar requirement before. I do not believe it is currently possible to do what you ask.

    You can get rid of the word "page" via  an overriding PAGETEXT specification, but I think the number will always be printed.

    You might be able to avoid the wrapping by using a LL override.

    I hope this begins to help.

    Regards,




    ------------------------------
    Jeroen Tiggelman
    IBM - Software Development Manager IBM Security zSecure Suite
    Delft
    ------------------------------



  • 3.  RE: Sending Email with long message but Date and Page number interfering with message.

    Posted Fri December 22, 2023 07:33 AM
    Edited by Rob van Hoboken Fri December 22, 2023 07:34 AM

    You might consider using NEWLIST NOPAGE and LIST family commands to write both the report headers AND the column headers to your output file.  That means, you would have to figure out how many spaces between the column headers you need to fit the data columns.

    I seem to remember you cannot have 2 NEWLISTs to generate 1 email, so I guess you would have to use SUMMARY instead of SORTLIST to build your report with a leading text, and you could look at the compliance (AU.R) CARLa code for inspiration (CKALSTD).

    newlist type=RACF_ACCESS nopage
      select class=surrogat profile=USERID.SUBMIT                     
      summary 'The following message is very long so I used a TopTitle and', 
       / 'Title and SubTitle. I am sending this report in an email',     
       / 'Undefined user ID in 1st qualifier of profile',
       /,
       / ' Profile'(44) 'Class'(8),
       complex(nd) count(nd),
    * profile class count(nd)

    ------------------------------
    Rob van Hoboken
    ------------------------------



  • 4.  RE: Sending Email with long message but Date and Page number interfering with message.

    Posted Fri December 22, 2023 12:08 PM

    Thanks Jeroen and Rob, I did some testing and the LL helped keep the page number on the first line of the email, however you need to be careful when using LL with a long message, if your message goes past the length specified in the LL statement it will chopped off and not show up in the message. 

    I also found the Title is always placed in the subject of the email, so if message is large you might want to place the large message in the ST field.  



    ------------------------------
    Scott Lahner
    ------------------------------



  • 5.  RE: Sending Email with long message but Date and Page number interfering with message.

    Posted Sat December 23, 2023 10:39 PM

    you can modify the formatting of your email content to ensure that the date and page number are placed correctly.

    OPTION smtpclass=B smtpwriter=CSSMTP smtpatsign=@,
           mt=`&mailto`,
           from=`&mailfrom`,
           mfs=3;

    data _null_;
      file cssmtp;
      
      /* Email header and introductory message */
      put "Subject: Your Subject";
      put "Content-Type: text/plain";
      put;
      put "Dear Recipient,";
      put;

      /* TopTitle block */
      put 'The following message is very long so I used a TopTitle and';
      put 'Title and SubTitle. I am sending this report in an email';
      put ' ';

      /* Report content block */
      newlist type=RACF_ACCESS,
              tt=' ', /* Add an empty line after the TopTitle */
              t='Undefined user ID in 1st qualifier of profile';
      
      /* Close the data step to flush the output */
    run;

    /* Rest of your existing code for the report generation */
    newlist type=RACF_ACCESS,
            tt=' ',
            t='Undefined user ID in 1st qualifier of profile'
      select class=surrogat profile=USERID.SUBMIT
      sortlist profile class;
    or use use the ODS ESCAPECHAR method
    like this

    /* Set ODS ESCAPECHAR to control formatting */
    ods escapechar='^';

    /* Define macro variables for date and page number */
    %let today = %sysfunc(today(), date9.);
    %let pageno = 1;

    /* Generate report */
    ods listing close;
    ods html file=_webout style=htmlblue;

    title1 j=l "^S={preimage=''}^S={just=l font_weight=bold}The following message is very long so I used a TopTitle and";
    title2 j=l "^S={preimage=''}^S={just=l font_weight=bold}Title and SubTitle. I am sending this report in an email";

    proc print data=sashelp.class;
    run;

    /* Include date and page number in the report */
    ods text="^S={preimage=''}^S={just=l font_weight=bold}&today. ^S={preimage=''}^S={just=r font_weight=bold}page &pageno.";

    ods html close;
    ods listing;

    /* Reset ODS ESCAPECHAR */
    ods escapechar='^';

     



    ------------------------------
    Zimba toki
    ------------------------------