havent had much time to progress the article but thought it would be worth posting up what I had here prior to completion to see if anyone found it useful.
We recently had a request to provide information on all our reporting procedures, which are primarily delivered by Report Caster, detailing the purpose of the reports. We found that we didn’t hold any additional documentation for many of the historic jobs that had been ported from our old mainframe environment. The ideal solution needed to be a simple method of recording this information with the minimum of input.
I opted to create an application using the report caster tables BOTSCHED & BOTTASK. This meant that all the distribution information etc was already available and duplicate input was not required. I created an additional table called BOTADDITIONAL to hold the inputted notes.
The following is a summary of the tables. In each case, packetid is the key field.
BOTSCHED
Parent entry of information in report caster. (default RC table)
BOTTASK
Entry for each of the tasks associated to the parent entry. (default RC table)
BOTADDITIONAL
Entry for each occurrence of packetid in BOTSCHED. (user created table)
I shall be incorporating additional tables in future releases. i.e BOTDEST which contains the individual email addresses of email recipients. The application detailed in this article is more of a starting point to provide an easily implemented solution
Before I continue this article, one thing to note is how we enter jobs in Report Caster. Each job is allocated an ID using the logic RCnnnnn. This Id is entered as the first 6 character of the Job Description and is parsed within the fex’s that read the information.
The following part screen shot shows a test entry and is the main view of the application. I have omitted the top part of the screen which contains our company logo and department information.
This is the code for the reporting procedure executed in iframe1 of the application and is executed upon launch to present all the procedures in a scrollable window. The search button is set to re-present any jobs meeting the search criteria within the same window.
SET HTMLCSS = ON
SET PAGE-NUM = OFF
SET LEFTMARGIN = 0
SET TITLE = ON
SET TOPMARGIN = 0
-*****************************************************************************
-* random value to include in the drill down URL
-*****************************************************************************
-SET &RANDOM = RDUNIF(D5) * RDUNIF(D5) * 10000;
-RUN
-*****************************************************************************
-* default values for initial report run
-*****************************************************************************
-DEFAULTS &JOBVAR=' ';
-RUN
JOIN PACKETID IN BOTSCHED TO ALL PACKETID IN BOTTASK AS PBY
DEFINE FILE BOTSCHED
-*****************************************************************************
-* Extracting allocated job ID fromJob Description
-*****************************************************************************
RCID/A6=EDIT(JOBDESC,'999999');
RANDOM/A10='&RANDOM';
-*****************************************************************************
-*Converting Job description to Upper Case for search logic
-*****************************************************************************
UJOBDESC/A255=UPCASE(255, JOBDESC, 'A255');
-*****************************************************************************
-*Drill down values for main report
-*****************************************************************************
ADDNOTE/A8='Add Note';
DETAILS/A7='Details';
END
TABLE FILE BOTSCHED
PRINT
PACKETID NOPRINT
RANDOM NOPRINT
BY RCID AS 'ID'
BY JOBDESC AS 'Job Description'
BY MAILSUBJECT AS 'Subject title'
BY ADDNOTE AS ' '
BY DETAILS AS ' '
-*****************************************************************************
-*Optional where statement depending on whether a search value has been sent
-*****************************************************************************
-IF &JOBVAR EQ ' ' GOTO SKIPVAR;
WHERE UJOBDESC CONTAINS '&JOBVAR'
-SKIPVAR
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
-*****************************************************************************
-*Calling the Detailed view report
-*****************************************************************************
TYPE=DATA,
COLUMN=N5,
TARGET='_parent',
FOCEXEC=rc_kick_detailed( \
JOBVAR=N2 \
RANDOM=N7 \
PACKVAR=N6 \
),
$
-*****************************************************************************
-* Calling the application that allows the updating of notes
-*****************************************************************************
TYPE=DATA,
SQUEEZE=OFF,
COLUMN=N4,
TARGET='_parent',
FOCEXEC=rc_kick_update_notes( \
JOBVAR=N2 \
RANDOM=N7 \
),
$
TYPE=TITLE,
STYLE=-UNDERLINE+BOLD,
$
ENDSTYLE
END
Clicking the ‘Details’ link allows us to view further details about the Job Description. This executes rc_kick_detailed, which in turn brings up a further HTML page. This HTML page contains 2 reports showing recipient/distribution list, tasks, output format & also any notes that have been input.
This report can include as much information as you require but we found this would suffice our current requirements.
The code for the above report is as shown below.
SET HTMLCSS = ON
SET PAGE-NUM = OFF
SET LEFTMARGIN = 0
SET TITLE = ON
SET TOPMARGIN = 0
-*****************************************************************************
-* random value to include in the drill down URL
-*****************************************************************************
-SET &RANDOM = RDUNIF(D5) * RDUNIF(D5) * 10000;
-RUN
-DEFAULTS &JOBVAR=' ', &NVAR=' '
-RUN
JOIN PACKETID IN BOTSCHED TO ALL PACKETID IN BOTTASK
DEFINE FILE BOTSCHED
RCID/A6=EDIT(JOBDESC,'999999');
ADDNOTE/A8='Add Note';
RANDOM/A10='&RANDOM';
END
TABLE FILE BOTSCHED
PRINT
PACKETID NOPRINT
TASKOBJ AS 'Focexec'
SENDFORMAT AS 'Output Format'
RANDOM NOPRINT
BY RCID AS 'ID'
BY JOBDESC AS 'Job Description'
BY MAILSUBJECT AS 'Subject title'
BY DISTLIST AS 'Distribution'
BY CASTER_USER AS 'RC Segment' NOPRINT
-************************************************************
-*Retrieving job description sopecified from the main view
-************************************************************
WHERE JOBDESC EQ '&JOBVAR'
HEADING
"ID <+0>
1> "
"Job Description <+0> 1> "
"Edit Notes 3> "
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET STYLE *
UNITS=IN,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
$
TYPE=TITLE,
STYLE=-UNDERLINE+BOLD,
$
TYPE=HEADING,
LINE=1,
ITEM=1,
STYLE=BOLD,
SIZE=13,
$
TYPE=HEADING,
LINE=3,
ITEM=1,
STYLE=BOLD,
SIZE=13,
$
TYPE=HEADING,
LINE=1,
ITEM=2,
POSITION=1.64,
SIZE=15,
STYLE=BOLD,
$
TYPE=HEADING,
LINE=3,
ITEM=2,
POSITION=.5,
STYLE=BOLD,
SIZE=15,
$
TYPE=HEADING,
LINE=5,
TARGET='_parent',
FOCEXEC=rc_kick_update_notes( \
JOBVAR='&JOBVAR' \
PACKVAR=N6 \
RANDOM=N10 \
),
$
ENDSTYLE
END
The job to update the notes we called rc_update_notes & the code is shown below.
SET HOLDFORMAT = ALPHA
SET HOLDLIST = PRINTONLY
TABLE FILE BOTSCHED
PRINT JOBDESC
WHERE RECORDLIMIT EQ 1
WHERE PACKETID EQ '&PACKVAR'
ON TABLE HOLD AS RCNVAR
END
-RUN
-READ RCNVAR &JOBVAR2.A90
-RUN
-SET &JOBVAR=EDIT(&JOBVAR2,'$$$$$$999999999999999999999999999999999999999999999999999999999999999999999999999999999999');
END
TABLE FILE BOTSCHED
PRINT PACKETID NOPRINT
COMPUTE SQL/A500 = 'DELETE FROM dbo.BOTADDITIONAL WHERE PACKETID =(' ||
'''' || PACKETID || '''' ||
')';
WHERE RECORDLIMIT EQ 1
WHERE PACKETID EQ '&PACKVAR'
ON TABLE HOLD AS JUPDEL
END
-RUN
TABLE FILE BOTSCHED
PRINT PACKETID NOPRINT
COMPUTE SQL/A500 = 'INSERT INTO dbo.BOTADDITIONAL (PACKETID, BOTNOTE) VALUES (' ||
'''' || PACKETID || '''' ||
', ''' || '&NOTEVAL' || '''' ||
')';
WHERE RECORDLIMIT EQ 1
WHERE PACKETID EQ '&PACKVAR'
ON TABLE HOLD AS JUPADD
END
-RUN
SQL
-INCLUDE JUPDEL
END
SQL
-INCLUDE JUPADD
END
81.05 All formats