21
Sat, Dec
3 New Articles

List Source Maintenance Activity

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

A utility to list the last time source members were modified.

All day long you've been making program changes in several source files. Now it's 4:30 p.m. and, in order to go home with a clear conscience, you need to recompile all the members affected; the trouble is that you cannot remember what members you changed. Or maybe you suspect that one of your programmers has edited source members but has not recompiled some of them. In either case, you need a way to identify the source members that have been edited.

Wouldn't it be nice to run a command that listed all edited source members to show where work had been done? Or to check that the programming staff is putting descriptions on all new source members? Or just to see what's changed during the week you were away?

The List Edited Source (LSTEDTSRC) command can do that and much more; a sample listing is shown in 1.

The List Edited Source (LSTEDTSRC) command can do that and much more; a sample listing is shown in Figure 1.

Four parameters allow the command to select various edited source members on the system. The member (MBR) parameter allows entry of a generic name. For example, if you wanted to see all the edited source for Parts Order Entry, you could specify POE* to list them.

A single library, a group of libraries, the job's library list, or all user (*ALLUSR) libraries can be searched for source files. Libraries entered in the list must exist on your system or the command will issue an error message. If *ALLUSR is used, this command may take some time to finish because a Display File Description (DSPFD) command is executed against all user files.

Additionally, a date range may be specified. Both dates must be valid, and the beginning date must be earlier than or the same as the ending date.

When the command is executed, a validity checking program makes sure the libraries are valid (unless special values *LIBL or *ALLUSR are entered). This program also checks the beginning and ending dates.

In the command processing program, copies of IBM-supplied files QAFDBASI and QAFDMBRL in QTEMP are used to receive the output from the DSPFD command. Using these files means that they do not have to be created to compile the command. This program also uses QUSRTOOL's Convert Binary to Decimal (CVTBINDEC) command. To install this tool, refer to page 26.

For each library or special value entered, the command displays all files and adds them to QAFDBASI in QTEMP. Once all files in the library have been displayed, the command opens the outfile, selecting all files with a data type of S (for source).

For each source file in the selected libraries, a DSPFD puts member information in an outfile. From this output, the command processing program selects records whose last change date is in the range selected when the command was entered.

The report that the command produces shows the library, source file, member, source type, member description, date created, date changed and the number of records. We have found this report useful in many situations.


List Source Maintenance Activity

Figure 1 Sample report, unable to reproduce


List Source Maintenance Activity

Figure 2 Command LSTEDTSRC

 LSTEDTSRC: CMD PROMPT('List Edited Source Members') PARM KWD(MBR) TYPE(*GENERIC) LEN(10) DFT(*ALL) + SPCVAL((*ALL)) PROMPT('Member') PARM KWD(LIB) TYPE(*NAME) LEN(10) DFT(*ALLUSR) + SPCVAL((*ALLUSR) (*LIBL)) MAX(20) + PROMPT('Library') PARM KWD(BGNDAT) TYPE(*DATE) PROMPT('Beginning + date') PARM KWD(ENDDAT) TYPE(*DATE) PROMPT('Ending date') 
List Source Maintenance Activity

Figure 3 Validity checking CL program EDT001CL

 EDT001CL: + PGM PARM(&MBR &LIBS &BGNDAT &ENDDAT) DCL VAR(&BGNDAT) TYPE(*CHAR) LEN(7) DCL VAR(&BIN) TYPE(*CHAR) LEN(2) DCL VAR(&COUNT) TYPE(*DEC) LEN(3 0) DCL VAR(&ENDDAT) TYPE(*CHAR) LEN(7) DCL VAR(&ERROR) TYPE(*LGL) LEN(1) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&LIBS) TYPE(*CHAR) LEN(252) DCL VAR(&#LIBS) TYPE(*DEC) LEN(5 0) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&MSG) TYPE(*CHAR) LEN(80) DCL VAR(&START) TYPE(*DEC) LEN(3 0) CHGVAR VAR(&BIN) VALUE(%SST(&LIBS 1 2)) CVTBINDEC FROMBIN(&BIN) TODEC(&#LIBS) /* This tests for generic entry as the first library */ IF COND(%SST(&LIBS 3 10) *EQ '*ALLUSR' *OR %SST(&LIBS 3 10) *EQ + '*LIBL') THEN(DO) IF COND(&#LIBS *GT 1) THEN(DO) SNDPGMMSG MSGID(CPD0006) MSGF(QCPFMSG) MSGDTA('0000 + Only one library may be entered when + *ALLUSR or *LIBL selected.') MSGTYPE(*DIAG) CHGVAR VAR(&ERROR) VALUE('1') ENDDO GOTO CMDLBL(DATCHK) ENDDO START: + CHGVAR VAR(&START) VALUE(&COUNT * 10 + 3) CHGVAR VAR(&LIB) VALUE(%SST(&LIBS &START 10)) /* Check for the existence of the entered libraries */ CHKOBJ OBJ(&LIB) OBJTYPE(*LIB) MONMSG MSGID(CPF9801) EXEC(DO) SNDPGMMSG MSGID(CPD0006) MSGF(QCPFMSG) MSGDTA('0000 + Library' *BCAT &LIB *BCAT 'not found.') + MSGTYPE(*DIAG) CHGVAR VAR(&ERROR) VALUE('1') ENDDO CHGVAR VAR(&COUNT) VALUE(&COUNT + 1) IF COND(&COUNT *LT &#LIBS) THEN(GOTO CMDLBL(START)) /* Make sure beginning date is less than ending date */ DATCHK: + IF COND(&BGNDAT *GT &ENDDAT) THEN(DO) SNDPGMMSG MSGID(CPD0006) MSGF(QCPFMSG) MSGDTA('0000 + Beginning date is greater than ending + date.') MSGTYPE(*DIAG) CHGVAR VAR(&ERROR) VALUE('1') ENDDO ERRCHK: + IF COND(&ERROR) THEN(SNDPGMMSG MSGID(CPF0002) MSGF(QCPFMSG) + MSGTYPE(*ESCAPE)) ENDPGM 
List Source Maintenance Activity

Figure 4 Command Processing CL program EDT001CLA

 EDT001CLA: + PGM PARM(&MBR &LIBS &BGNDAT &ENDDAT) DCLF FILE(QAFDBASI) DCL VAR(&BGNDAT) TYPE(*CHAR) LEN(7) DCL VAR(&BGNDAT6) TYPE(*CHAR) LEN(6) DCL VAR(&BIN) TYPE(*CHAR) LEN(2) DCL VAR(&COUNT) TYPE(*DEC) LEN(3 0) DCL VAR(&ENDDAT) TYPE(*CHAR) LEN(7) DCL VAR(&ENDDAT6) TYPE(*CHAR) LEN(6) DCL VAR(&INCLUDE) TYPE(*DEC) LEN(3 0) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&LIBLIST) TYPE(*CHAR) LEN(250) DCL VAR(&LIBS) TYPE(*CHAR) LEN(252) DCL VAR(&#LIBS) TYPE(*DEC) LEN(5 0) DCL VAR(&MBR) TYPE(*CHAR) LEN(10) DCL VAR(&START) TYPE(*DEC) LEN(3 0) CHGVAR VAR(&BIN) VALUE(%SST(&LIBS 1 2)) CVTBINDEC FROMBIN(&BIN) TODEC(&#LIBS) CHGVAR VAR(&COUNT) VALUE(1) CLRPFM FILE(QTEMP/QAFDBASI) MBR(*FIRST) MONMSG MSGID(CPF0000) CLRPFM FILE(QTEMP/QAFDMBRL) MBR(*FIRST) MONMSG MSGID(CPF0000) LOOP_FILE: + CHGVAR VAR(&START) VALUE(&COUNT * 10 - 7) CHGVAR VAR(&LIB) VALUE(%SST(&LIBS &START 10)) DSPFD FILE(&LIB/*ALL) TYPE(*BASATR) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/QAFDBASI) OUTMBR(*FIRST *ADD) IF COND(&COUNT *LT &#LIBS) THEN(DO) CHGVAR VAR(&COUNT) VALUE(&COUNT + 1) GOTO CMDLBL(LOOP_FILE) ENDDO OPNQRYF FILE((QTEMP/QAFDBASI)) QRYSLT('ATDTAT *EQ ''S''') + KEYFLD((ATLIB) (ATFILE)) OVRDBF FILE(QAFDBASI) TOFILE(QTEMP/QAFDBASI) SHARE(*YES) LOOP_MBR: + RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END_MBR)) DSPFD FILE(&ATLIB/&ATFILE) TYPE(*MBRLIST) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/QAFDMBRL) OUTMBR(*FIRST *ADD) GOTO CMDLBL(LOOP_MBR) END_MBR: + CHGVAR VAR(&BGNDAT6) VALUE(%SST(&BGNDAT 2 6)) CHGVAR VAR(&ENDDAT6) VALUE(%SST(&ENDDAT 2 6)) IF COND(&MBR *EQ '*ALL') THEN(CHGVAR VAR(&MBR) VALUE('*')) OPNQRYF FILE((QTEMP/QAFDMBRL)) QRYSLT('MLCHGD *EQ %RANGE(''' + *CAT &BGNDAT6 *CAT ''' ''' *CAT &ENDDAT6 *CAT ''') *AND + MLNAME *EQ %WLDCRD(''' *CAT &MBR *TCAT ''')') OVRDBF FILE(QAFDMBRL) TOFILE(QTEMP/QAFDMBRL) SHARE(*YES) IF COND(&MBR *EQ '*') THEN(CHGVAR VAR(&MBR) VALUE(*ALL)) CHGVAR VAR(&INCLUDE) VALUE(&#LIBS * 10) CHGVAR VAR(&LIBLIST) VALUE(%SST(&LIBS 3 &INCLUDE)) CALL PGM(EDT001RG) PARM(&MBR &LIBLIST &BGNDAT6 &ENDDAT6) ENDPGM 
List Source Maintenance Activity

Figure 5 Printer file EDT001P1

 A REF(QAFDMBRL) * A R HDR1 SKIPB(2) A 1DATE EDTCDE(Y) A 11TIME A 52'List Edited Source Members' A 112'LSTEDTSRC - Page' A 129PAGNBR EDTCDE(3) A SPACEA(1) A 1'Member:' A MBR 10 10 A 50'From' A BGNDAT 6 0 55EDTCDE(Y) A 69'To' A ENDDAT 6 0 72EDTCDE(Y) A 113'Library:' A LIBNAM 10 123 A SPACEA(3) * A R HDR2 A 1'Report Options:' A 23'Member:' A MBR 10 40 A SPACEA(2) A 23'Libraries:' A SPACEA(0) * A R HDR3 SPACEA(1) A LIB 10 40 * A R HDR4 A 1'Library' A 13'Src File' A 25'Member' A 37'Src Type' A 48'Text Description' A 100'Crt Date' A 110'Chg Date' A 122'Nbr Records' A SPACEA(2) * A R DETAIL SPACEA(1) A MLLIB R 1 A MLFILE R 13 A MLNAME R 25 A MLSEU2 R 37 A MLMTXT R 48 A CRTDAT 6 0 100EDTCDE(Y) A CHGDAT 6 0 110EDTCDE(Y) A MLNRCD R 120EDTCDE(1) 
List Source Maintenance Activity

Figure 6 RPG program EDT001RG

 FQAFDMBRLIP E K DISK FEDT001P1O E 98 PRINTER * C *IN98 IFEQ *ON C WRITEHDR1 C WRITEHDR4 C MOVE *OFF *IN98 C ENDIF * C MOVE MLCDAT CRTDAT C MULT 100.0001 CRTDAT C MOVE MLCHGD CHGDAT C MULT 100.0001 CHGDAT C WRITEDETAIL * C *INZSR BEGSR C *ENTRY PLIST C PARM MBR C PARM LIBS 250 C PARM BGNDT@ 6 C PARM ENDDT@ 6 C MOVE BGNDT@ BGNDAT C MOVE ENDDT@ ENDDAT C MULT 100.0001 BGNDAT C MULT 100.0001 ENDDAT C 10 SUBSTLIBS:11 TEST10 10 C TEST10 IFNE *BLANK C MOVEL'*LIST' LIBNAM C ELSE C MOVELLIBS LIBNAM C ENDIF C WRITEHDR1 C WRITEHDR2 C 1 DO 25 J 20 C J MULT 10 K 30 C SUB 9 K C 10 SUBSTLIBS:K LIB C LIB IFEQ *BLANK C LEAVE C ENDIF C WRITEHDR3 C ENDDO C WRITEHDR1 C WRITEHDR4 C ENDSR 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

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: