18
Thu, Apr
5 New Articles

TechTalk: Sign-on Newsletter

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

IBM gave us two ways to send a message to all users: SNDMSG to *ALLWS, and SNDBRKMSG to *ALLACT. These methods, however, leave it to the receiving user to remove the messages from their message queues after reading them. Most users, though, forget to do so. The result is that message queues steadily increase in size unless periodically cleaned up.

Using the sign-on display is a better way to distribute a "newsletter." After all, every user must see the sign-on display. The technique presented here discusses that approach.

First, customize your sign-on display in such a way that messages are shown on it. Execute the following commands:

 CRTMSGF MSGF(lib_name/SGN001MF) + TEXT('Message file for + Sign-On Newsletter') ADDMSGD MSGID(SGN0001) + MSGF(lib_name/SGN001MF) + MSG(' ') 

Notice that the message file was created in library "lib_name." This must be the name of a library that is part of the system portion of the library list. Repeat the last command 15 more times, using MSGIDs SGN0002 to SGN0016. Now copy the sign-on display source code:

 CPYSRCF FROMFILE(QGPL/QDDSSRC) + TOFILE(lib_name/QDDSSRC) + FROMMBR(QDSIGNON) + TOMBR(SGN001DF) + MBROPT(*ADD) 

Start SEU to edit member SGN001DF in source file lib_name/QDDSSRC, changing it to match 4a. Please notice that the last field, MSG16, is only 78 characters long (while MSG1 to MSG15 are 79 characters long). This is needed to allow the system to display the error messages on the sign-on display; if MSG16 were enlarged to 79 characters, the last byte would "eat" the attribute byte of the error message. When you're done with this change, create the display file and make it the sign-on display file for subsystem QINTER:

Start SEU to edit member SGN001DF in source file lib_name/QDDSSRC, changing it to match Figure 4a. Please notice that the last field, MSG16, is only 78 characters long (while MSG1 to MSG15 are 79 characters long). This is needed to allow the system to display the error messages on the sign-on display; if MSG16 were enlarged to 79 characters, the last byte would "eat" the attribute byte of the error message. When you're done with this change, create the display file and make it the sign-on display file for subsystem QINTER:

 CRTDSPF FILE(lib_name/SGN001DF) + SRCFILE(lib_name/QDDSSRC) + MAXDEV(256) CHGSBSD SBSD(QINTER) + SGNDSPF(lib_name/SGN001DF) 

QINTER will show the new sign-on display the next time it is started.

You can now create display file NWS001DF, CL program NWS001CL, and command CHGNWSLTR (Figures 4b, 4c, and 4d, respectively), which are used to change the newsletter area of QINTER's sign-on display. As in the modified sign-on display, display file NWS001DF has a MSG16 field which must be only 78 characters long in order to match the last message line of the sign-on newsletter.

Simply execute command CHGNWSLTR (no parameters), which displays a facsimile of QINTER's sign-on display, presenting the current newsletter text. Type over it (or blank it out, as you wish), and press Enter. Your users will see the newsletter as soon as the sign-on display is redisplayed -- such as when a user signs off, or when QINTER is started.


TechTalk: Sign-on Newsletter

Figure 4A Customized Sign-On display (SGN001DF)

 A DSPSIZ(24 80 *DS3) A R SIGNON A CLEAR A BLINK A 1 23' Sign On ' A DSPATR(HI) A 2 2'System . . . . . :' A SYSNAME 8A O 2 23 A 3 2'Subsystem . . . . :' A SBSNAME 10A O 3 23 A 4 2'Display . . . . . :' A DEVNAME 10A O 4 23 A 2 36'User . . . . . . . . . . . . . .' A USERID 10A B 2 71 A 01 3 36'Password . . . . . . . . . . . .' A 01 PASSWRD 10A I 3 71DSPATR(ND) A 4 36'Program/procedure . . . . . . . .' A PROGRAM 10A B 4 71CHECK(LC) A 5 36'Menu . . . . . . . . . . . . . .' A MENU 10A B 5 71CHECK(LC) A 6 36'Current library . . . . . . . . .' A CURLIB 10A B 6 71CHECK(LC) A 02 QSNERROR 80A O 24 1DSPATR(HI RI) A COPYRIGHT 40A O 24 40DSPATR(HI) A UBUFFER 128A H A MSG1 79A O 8 2MSGID(SGN 0001 SGN001MF) A DSPATR(HI) A MSG2 79A O 9 2MSGID(SGN 0002 SGN001MF) A DSPATR(HI) A MSG3 79A O 10 2MSGID(SGN 0003 SGN001MF) A DSPATR(HI) A MSG4 79A O 11 2MSGID(SGN 0004 SGN001MF) A DSPATR(HI) A MSG5 79A O 12 2MSGID(SGN 0005 SGN001MF) A DSPATR(HI) A MSG6 79A O 13 2MSGID(SGN 0006 SGN001MF) A DSPATR(HI) A MSG7 79A O 14 2MSGID(SGN 0007 SGN001MF) A DSPATR(HI) A MSG8 79A O 15 2MSGID(SGN 0008 SGN001MF) A DSPATR(HI) A MSG9 79A O 16 2MSGID(SGN 0009 SGN001MF) A DSPATR(HI) A MSG10 79A O 17 2MSGID(SGN 0010 SGN001MF) A DSPATR(HI) A MSG11 79A O 18 2MSGID(SGN 0011 SGN001MF) A DSPATR(HI) A MSG12 79A O 19 2MSGID(SGN 0012 SGN001MF) A DSPATR(HI) A MSG13 79A O 20 2MSGID(SGN 0013 SGN001MF) A DSPATR(HI) A MSG14 79A O 21 2MSGID(SGN 0014 SGN001MF) A DSPATR(HI) A MSG15 79A O 22 2MSGID(SGN 0015 SGN001MF) A DSPATR(HI) A MSG16 78A O 23 2MSGID(SGN 0016 SGN001MF) A DSPATR(HI) 
TechTalk: Sign-on Newsletter

Figure 4B Display file NWS001DF

 A* 91/01/17 13:07:52 MALERN REL-R03M00 5728-PW1 A DSPSIZ(24 80 *DS3) A PRINT A INDARA A CHECK(AB) A R ENTER A* 91/01/17 13:07:52 MALERN REL-R03M00 5728-PW1 A CF03(03 'EXIT') A CF12(12 'CANCEL') A CF21(21 'Command line') A BLINK A 1 2'UPDNWSBLT' A COLOR(BLU) A 1 31'Update News Bulletin' A COLOR(WHT) A 3 2'Type text of this news bulletin:' A COLOR(BLU) A 4 2'Use' A COLOR(BLU) A 4 6'*' A COLOR(WHT) A 4 8'on left margin to highlight the A line in' A COLOR(BLU) A 4 48'white.' A COLOR(WHT) A LINE01 75A B 5 2CHECK(LC) A LINE02 75A B 6 2CHECK(LC) A LINE03 75A B 7 2CHECK(LC) A LINE04 75A B 8 2CHECK(LC) A LINE05 75A B 9 2CHECK(LC) A LINE06 75A B 10 2CHECK(LC) A LINE07 75A B 11 2CHECK(LC) A LINE08 75A B 12 2CHECK(LC) A LINE09 75A B 13 2CHECK(LC) A LINE10 75A B 14 2CHECK(LC) A LINE11 75A B 15 2CHECK(LC) A LINE12 75A B 16 2CHECK(LC) A LINE13 75A B 17 2CHECK(LC) A LINE14 75A B 18 2CHECK(LC) A LINE15 75A B 19 2CHECK(LC) A LINE16 75A B 20 2CHECK(LC) A LINE17 75A B 21 2CHECK(LC) A LINE18 75A B 22 2CHECK(LC) A 23 2'F3=Exit F12=Cancel A Enter=Store- A F21=Cmd line' A COLOR(BLU) 
TechTalk: Sign-on Newsletter

Figure 4C CL program NWS001CL

 nws001cl: + pgm dclf file(nws001df) dcl var(&dtaara) type(*char) len(10) /* If data area does not exist, create it. */ chgvar var(&dtaara) value($nwsblt) chkobj obj(nwsbltlib/$nwsblt) objtype(*dtaara) monmsg msgid(cpf9801) exec(do) chgvar var(&dtaara) value($$nwsblt) crtdtaara dtaara(nwsbltlib/$$nwsblt) type(*char) len(1350) + text('News Bulletin data area') aut(*all) enddo /* Retrieve current text of news bulletin before displaying */ rtvdtaara dtaara(nwsbltlib/&dtaara (0001 75)) rtnvar(&line01) rtvdtaara dtaara(nwsbltlib/&dtaara (0076 75)) rtnvar(&line02) rtvdtaara dtaara(nwsbltlib/&dtaara (0151 75)) rtnvar(&line03) rtvdtaara dtaara(nwsbltlib/&dtaara (0226 75)) rtnvar(&line04) rtvdtaara dtaara(nwsbltlib/&dtaara (0301 75)) rtnvar(&line05) rtvdtaara dtaara(nwsbltlib/&dtaara (0376 75)) rtnvar(&line06) rtvdtaara dtaara(nwsbltlib/&dtaara (0451 75)) rtnvar(&line07) rtvdtaara dtaara(nwsbltlib/&dtaara (0526 75)) rtnvar(&line08) rtvdtaara dtaara(nwsbltlib/&dtaara (0601 75)) rtnvar(&line09) rtvdtaara dtaara(nwsbltlib/&dtaara (0676 75)) rtnvar(&line10) rtvdtaara dtaara(nwsbltlib/&dtaara (0751 75)) rtnvar(&line11) rtvdtaara dtaara(nwsbltlib/&dtaara (0826 75)) rtnvar(&line12) rtvdtaara dtaara(nwsbltlib/&dtaara (0901 75)) rtnvar(&line13) rtvdtaara dtaara(nwsbltlib/&dtaara (0976 75)) rtnvar(&line14) rtvdtaara dtaara(nwsbltlib/&dtaara (1051 75)) rtnvar(&line15) rtvdtaara dtaara(nwsbltlib/&dtaara (1126 75)) rtnvar(&line16) rtvdtaara dtaara(nwsbltlib/&dtaara (1201 75)) rtnvar(&line17) rtvdtaara dtaara(nwsbltlib/&dtaara (1276 75)) rtnvar(&line18) again: + sndrcvf if cond(&in21) then(do) call pgm(quscmdln) goto cmdlbl(again) enddo if cond(&in03 *or &in12) then(do) if cond(&dtaara *eq '$$NWSBLT') then(do) dltdtaara dtaara(nwsbltlib/$$nwsblt) enddo goto cmdlbl(endpgm) enddo /* Update data area */ chgdtaara dtaara(nwsbltlib/&dtaara (0001 75)) value(&line01) chgdtaara dtaara(nwsbltlib/&dtaara (0076 75)) value(&line02) chgdtaara dtaara(nwsbltlib/&dtaara (0151 75)) value(&line03) chgdtaara dtaara(nwsbltlib/&dtaara (0226 75)) value(&line04) chgdtaara dtaara(nwsbltlib/&dtaara (0301 75)) value(&line05) chgdtaara dtaara(nwsbltlib/&dtaara (0376 75)) value(&line06) chgdtaara dtaara(nwsbltlib/&dtaara (0451 75)) value(&line07) chgdtaara dtaara(nwsbltlib/&dtaara (0526 75)) value(&line08) chgdtaara dtaara(nwsbltlib/&dtaara (0601 75)) value(&line09) chgdtaara dtaara(nwsbltlib/&dtaara (0676 75)) value(&line10) chgdtaara dtaara(nwsbltlib/&dtaara (0751 75)) value(&line11) chgdtaara dtaara(nwsbltlib/&dtaara (0826 75)) value(&line12) chgdtaara dtaara(nwsbltlib/&dtaara (0901 75)) value(&line13) chgdtaara dtaara(nwsbltlib/&dtaara (0976 75)) value(&line14) chgdtaara dtaara(nwsbltlib/&dtaara (1051 75)) value(&line15) chgdtaara dtaara(nwsbltlib/&dtaara (1126 75)) value(&line16) chgdtaara dtaara(nwsbltlib/&dtaara (1201 75)) value(&line17) chgdtaara dtaara(nwsbltlib/&dtaara (1276 75)) value(&line18) if cond(&dtaara *eq '$$NWSBLT') then(do) rnmobj obj(nwsbltlib/$$nwsblt) objtype(*dtaara) newobj($nwsblt) enddo /* End program */ endpgm: + endpgm 
TechTalk: Sign-on Newsletter

Figure 4D Command CHGNWSLTR

 CHGNWSLTR: CMD PROMPT('Change Sign-On Newsletter') 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: