diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASK.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASK.rex new file mode 100644 index 0000000..19f4211 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASK.rex @@ -0,0 +1,76 @@ +/* REXX */ + "ISREDIT MACRO" ; + TRACE Off ; + + /* AIASK - construct a Query and call MCP for Results */ + + IneedExpert = '' + /* Determine whether user has selected text */ + /* by excluding unwanted text */ + Address ISREDIT "FLIP" + Address ISREDIT "FIND p'=' 1 NX" + findRC = RC + If findRC = 0 then, + Do + Address ISREDIT "FIND 'IDENTIFICATION' WORD FIRST" + If RC = 0 then IneedExpert = 'a COBOL Expert' + If IneedExpert = '' then, + Do + Address ISREDIT "FIND 'C1G0202I' WORD FIRST" + If RC = 0 then IneedExpert = 'an Endevor Admin' + End + If IneedExpert = '' then, + Do + Address ISREDIT "FIND ' E N D E V O R ' FIRST" + If RC = 0 then IneedExpert = 'an Endevor Admin' + End + End + Address ISREDIT "FLIP" + If findRC = 0 then, + Do + Address ISREDIT "CUT NX AIASK REPLACE " + cutRC = RC + End + If IneedExpert = '' then, + Do + Address ISREDIT "FIND 'IDENTIFICATION' WORD FIRST NX" + If RC = 0 then IneedExpert = 'a COBOL Expert' + End + + + CALL BPXWDYN "INFO FI(QUERY)", + "INRTDSN(DSNVAR) INRDSNT(myDSNT)" + if Substr(DSNVAR,1,1) > ' ' then, + ADDRESS TSO "FREE F(QUERY)" + + /* Allocate an empty dataset for the query */ + /* Leverages the pre-existing generic edit macro named WITHMSG */ + ADDRESS TSO, + "ALLOC F(QUERY) LRECL(140) BLKSIZE(28000) SPACE(5,5)", + "RECFM(F B) TRACKS ", + "NEW UNCATALOG REUSE " + Push "Act like **AnExpert** and explain the following:" + ADDRESS TSO "EXECIO 1 DISKW QUERY (Finis" + + ADDRESS ISPEXEC "LMINIT DATAID(DDID) DDNAME(QUERY)" + + /* If text was selected (exposed not hidden) paste it here */ + If findRC = 0 then, + ADDRESS ISPEXEC "EDIT DATAID(&DDID) MACRO(AIASKMPA)" + + /* Insert standard messages for AIASK */ + /* ... and allow user to enter text... */ + If IneedExpert /= '' then Push IneedExpert + ADDRESS ISPEXEC "EDIT DATAID(&DDID) MACRO(AIASKMSG)" + If RC > 0 then Exit + + ADDRESS ISPEXEC "LMFREE DATAID(&DDID)" + + /* Now call the Rexx that calls Python + and shows the results */ + Call AIASKPY + + ADDRESS ISPEXEC "LMFREE DATAID(&DDID)" + + Exit + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKEXP.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKEXP.rex new file mode 100644 index 0000000..87dcc43 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKEXP.rex @@ -0,0 +1,54 @@ + /* REXX */ + /* Use the Application ID or the panel name */ + /* to determine what MCP expert is needed . */ + + ADDRESS ISPEXEC "VGET (ZPANELID) SHARED" + ADDRESS ISPEXEC "VGET (ZAPPLID) SHARED" + sa= "You are using ISPF panel Applid " ZPANELID ZAPPLID + + ShortApplid = Substr(ZAPPLID,1,4) + /*IneedExpert = 'an Endevor Admin' */ + ApplIDmap. = '?' + ApplIDmap.CTLI = 'an Endevor Admin' + ApplIDmap.CAWA = 'a File Master expert' + ApplIDmap.CA7@ = 'a CA7 expert' + ApplIDmap.CAMR = 'an InterTest expert' + ApplIDmap.GSVX = 'a SYSVIEW expert' + ApplIDmap.JCK0 = 'a JCLCheck expert' + ApplIDmap.TUNT = 'a Mainframe Application Tuner expert' + IneedExpert = ApplIDmap.ShortApplid + If IneedExpert /= '?' then Return IneedExpert + + thisPanelPrefix = Substr(ZPANELID,1,4) + EndevorPanelPrefixes = 'EN BC1 C1T C1P C1S ND PACM' + Do w# = 1 to Words(EndevorPanelPrefixes) + If Abbrev(ZPANELID,Word(EndevorPanelPrefixes,w#)) then, + Do + IneedExpert = 'an Endevor Admin' + Leave; + End /* If Abbrev(ZPANELID,Word ... */ + End /* Do w# = 1 to Words( .... */ + + If IneedExpert = '' then, + If Abbrev(ZPANELID,'ISREDDE') then, + IneedExpert = 'a COBOL expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'OP' ) then, + IneedExpert = 'an OPS/MVS expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'GSV' ) then, + IneedExpert = 'a SYSVIEW expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'TUN' ) then, + IneedExpert = 'a Mainframe Application Tuner expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'JCK' ) then, + IneedExpert = 'a JCLCheck expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'CSW' ) then, + IneedExpert = 'a File Master expert' + If IneedExpert = '' then, + If Abbrev(ZPANELID,'CAW' ) then, + IneedExpert = 'a File Master expert' + Return IneedExpert + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMCN.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMCN.rex new file mode 100644 index 0000000..4801b3a --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMCN.rex @@ -0,0 +1,9 @@ +/* REXX */ 00000100 + "ISREDIT MACRO" ; 00000200 + /* Save the Selected Text snippets */ 00000300 + Trace Off 00000400 + Sa= '(AIASKMCN)' 00000500 + ADDRESS ISREDIT " CUT AIASK " 00000600 + ADDRESS ISREDIT " CANCEL " 00000700 + EXIT 00000800 + 00000900 diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMND.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMND.rex new file mode 100644 index 0000000..91006b0 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMND.rex @@ -0,0 +1,41 @@ +/* REXX */ + "ISREDIT MACRO" ; + + Sa= 'PSP.CLIST(AIASKM02)' + ADDRESS ISPEXEC + 'VGET (ENVBENV ENVBSYS ENVBSBS ENVBTYP ENVBSTGI ENVBSTGN ', + 'ENVSENV ENVSSYS ENVSSBS ENVSTYP ENVSSTGI ENVSSTGN ', + 'ENVELM ENVPRGRP ENVCCID ENVCOM ENVGENE ENVOSIGN) ', + 'PROFILE' + If RC > 0 then, + Do + ADDRESS ISREDIT " CANCEL " + Exit + End + + ADDRESS ISREDIT "CAPS OFF" + ndvr.1 = "..." + ndvr.1 = "I am working on Endevor element" ENVELM, + "in Environment" ENVSENV "System" ENVSSYS + ndvr.1 = "Act like an Endevor admin and", + "explain the following:" + ndvr.2 = " Subsystem" ENVSSBS, + "Type" ENVSTYP "with processor group" ENVPRGRP "." + ndvr.3 = "..." + + ADDRESS ISREDIT " LINE_AFTER .ZLAST =", + "DATALINE '"ndvr.1"'" ; +/* + ADDRESS ISREDIT " LINE_AFTER .ZLAST =", + "DATALINE '"ndvr.2"'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST =", + "DATALINE '"ndvr.3"'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST =", + "DATALINE '"ndvr.4"'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST =", + "DATALINE '"ndvr.5"'" ; +*/ + ADDRESS ISREDIT " SAVE " + ADDRESS ISREDIT " CANCEL " + EXIT + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMPA.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMPA.rex new file mode 100644 index 0000000..914ac91 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMPA.rex @@ -0,0 +1,10 @@ +/* REXX */ 00000100 + "ISREDIT MACRO" ; 00000200 + /* Save the Selected Text snippets */ 00000300 + Trace Off 00000400 + Sa= 'PSP.CLIST(AIASKMPA)' 00000500 + ADDRESS ISREDIT " PASTE AIASK AFTER .ZLAST DELETE" 00000600 + ADDRESS ISREDIT " SAVE " 00000700 + ADDRESS ISREDIT " CANCEL " 00000800 + EXIT 00000900 + 00001000 diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMRS.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMRS.rex new file mode 100644 index 0000000..cc598f7 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMRS.rex @@ -0,0 +1,42 @@ +/* REXX */ + "ISREDIT MACRO" ; + /* Format and Show the AIASK response */ + /* Use Text Flow command to slim the response */ + /* to a 72-character-wide display. */ + Sa= '(AIASKMRS)' + TRACE Off ; + + Address ISREDIT "RESET" + Address ISREDIT "EXCLUDE ALL" + Address ISREDIT "FIND p'#$' 1 all" + Address ISREDIT "FIND p'##$' 1 all" + Address ISREDIT "CURSOR = " 1 1 + Do 300 + Address ISREDIT "FIND NEXT P'#' 1 NX" + If RC > 0 then Leave + ADDRESS ISREDIT " LINE_AFTER .ZCSR = DATALINE ' '" ; + If RC > 0 then Leave + End; + + Address ISREDIT "FIND LAST ' ' 1 " + If RC > 0 then exit + Address ISREDIT "FIND NEXT p'^' 1 " + If RC > 0 then Exit + Do 300 + Address ISREDIT "TFLOW .ZCSR 72" + Address ISREDIT "FIND PREV ' ' 1 " + If RC > 0 then Leave + Address ISREDIT "FIND PREV p'^' 1 " + If RC > 0 then Leave + Address ISREDIT "FIND PREV ' ' 1 " + If RC > 0 then Leave + Address ISREDIT "FIND NEXT p'^' 1 " + If RC > 0 then Leave + ADDRESS ISREDIT " (LPOS1,CPOS1) = CURSOR " ; + If LPOS1 < 3 then Leave + End; + Address ISREDIT "RESET" + Address ISREDIT "CUT AIASK" + + EXIT + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMS2.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMS2.rex new file mode 100644 index 0000000..26ee18b --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMS2.rex @@ -0,0 +1,45 @@ +/* REXX */ + /* Insert AIASK instruction messages */ + "ISREDIT MACRO" ; + + ndvr.1 = '"END" to continue / "CANCEL" to quit' + ndvr.2 = "Learn about AIASK here.... " + ndvr.3 = " https://techdocs.broadcom.com/endevor " + ndvr.4 = "Adjust or Enter your query above ... " + ndvr.5 = " " + Sa= 'PSP.CLIST(AIASKM03)' + ADDRESS ISREDIT " RESET " + "ISREDIT (LINE) = CURSOR" + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZLAST = NOTELINE '"ndvr.5"'" + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZLAST = NOTELINE '"ndvr.4"'" + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZLAST = NOTELINE '"ndvr.3"'" + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZLAST = NOTELINE '"ndvr.2"'" + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZLAST = NOTELINE '"ndvr.1"'" + + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; + + ADDRESS ISPEXEC "VGET (ZPANELID ZSCRNAME ZAPPLID) SHARED" + sa= "You are using:" ZPANELID ZSCRNAME ZAPPLID + + ADDRESS ISPEXEC 'VGET (ZVERB ZCMD) ASIS' + Sa= ZVERB ZCMD ZERRFLD ZERRMSG + ADDRESS ISPEXEC + 'VGET (ENVBENV ENVBSYS ENVBSBS ENVBTYP ENVBSTGI ENVBSTGN ', + 'ENVSENV ENVSSYS ENVSSBS ENVSTYP ENVSSTGI ENVSSTGN ', + 'ENVELM ENVPRGRP ENVCCID ENVCOM ENVGENE ENVOSIGN) ', + 'PROFILE' + If Queued() > 0 then Parse pull IneedExpert + Else, + If ENVSTYP = 'COBOL' then IneedExpert = 'a COBOL Expert' + Else, + If ZAPPLID = 'CTLI' then IneedExpert = 'an Endevor Admin' + Else, + IneedExpert = 'a COBOL Expert' + + ADDRESS ISREDIT "Change First '**AnExpert**'" , + "'"IneedExpert"'" + EXIT + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSG.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSG.rex new file mode 100644 index 0000000..90c0a1d --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSG.rex @@ -0,0 +1,45 @@ +/* REXX */ 00000100 + /* Insert AIASK instruction messages */ 00000200 + "ISREDIT MACRO" ; 00000300 + 00000400 + ndvr.1 = '"END" to continue / "CANCEL" to quit' 00000500 + ndvr.2 = "Learn about AIASK here.... " 00000600 + ndvr.3 = " https://techdocs.broadcom.com/endevor " 00000700 + ndvr.4 = "Adjust or Enter your query above ... " 00000800 + ndvr.5 = " " 00000900 + Sa= 'PSP.CLIST(AIASKMSG)' 00001000 + ADDRESS ISREDIT " RESET " 00001100 + "ISREDIT (LINE) = CURSOR" 00001200 + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZFIRST = NOTELINE '"ndvr.5"'" 00001300 + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZFIRST = NOTELINE '"ndvr.4"'" 00001400 + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZFIRST = NOTELINE '"ndvr.3"'" 00001500 + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZFIRST = NOTELINE '"ndvr.2"'" 00001600 + ADDRESS ISREDIT "ISREDIT LINE_AFTER .ZFIRST = NOTELINE '"ndvr.1"'" 00001700 + 00001800 + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; 00001900 + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; 00002000 + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; 00002100 + ADDRESS ISREDIT " LINE_AFTER .ZLAST = DATALINE '" "'" ; 00002200 + 00002300 + ADDRESS ISPEXEC "VGET (ZPANELID ZSCRNAME ZAPPLID) SHARED" 00002400 + sa= "You are using:" ZPANELID ZSCRNAME ZAPPLID 00002500 + 00002600 + ADDRESS ISPEXEC 'VGET (ZVERB ZCMD) ASIS' 00002700 + Sa= ZVERB ZCMD ZERRFLD ZERRMSG 00002800 + ADDRESS ISPEXEC 00002900 + 'VGET (ENVBENV ENVBSYS ENVBSBS ENVBTYP ENVBSTGI ENVBSTGN ', 00003000 + 'ENVSENV ENVSSYS ENVSSBS ENVSTYP ENVSSTGI ENVSSTGN ', 00003100 + 'ENVELM ENVPRGRP ENVCCID ENVCOM ENVGENE ENVOSIGN) ', 00003200 + 'PROFILE' 00003300 + If Queued() > 0 then Parse pull IneedExpert 00003400 + Else, 00003500 + If ENVSTYP = 'COBOL' then IneedExpert = 'a COBOL Expert' 00003600 + Else, 00003700 + If ZAPPLID = 'CTLI' then IneedExpert = 'an Endevor Admin' 00003800 + Else, 00003900 + IneedExpert = 'a COBOL Expert' 00004000 + 00004100 + ADDRESS ISREDIT "Change First '**AnExpert**'" , 00004200 + "'"IneedExpert"'" 00004300 + EXIT 00004400 + 00004500 diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSL.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSL.rex new file mode 100644 index 0000000..696b0f9 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKMSL.rex @@ -0,0 +1,9 @@ +/* REXX */ + "ISREDIT MACRO" ; + /* Save the Selected Text snippets */ + Sa= 'PSP.CLIST(AIASKM01)' + ADDRESS ISREDIT " PASTE AFTER .ZLAST DELETE" + ADDRESS ISREDIT " SAVE " + ADDRESS ISREDIT " CANCEL " + EXIT + diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKPY.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKPY.rex new file mode 100644 index 0000000..6cebc27 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/AIASKPY.rex @@ -0,0 +1,96 @@ +/* REXX */ +/* Call mfclient.py with the Query collected from ISPF */ +/* using the AIASK tool. */ +/* Present the response back to the user.... */ + Trace Off + + ADDRESS TSO "EXECIO * DISKR QUERY (stem qry. Finis" + ADDRESS TSO "FREE F(QUERY)" + sa= qry.0 + Message = '' +/*Do qry# = 3 to qry.0 */ + Do qry# = 1 to qry.0 + Message = Message Strip(Substr(qry.qry#,1,92)) + End + Message = Strip(Message) + Message = '"'Message'"' + + sa= 'AIASKPY message says:' Message + +/* Set up the variables for running Python */ + command = "sh cd /u/users/waljo11;", + "python python/mfclient.py" Message + stdout.0 = 0 + stderr.0 = 0 + stdin.0 = 0 + env.0 = 4 + env.1 = "PATH=" || , + "/usr/lpp/IBM/cyp/pyz/bin/:" || , + "/bin:/sys/java64bt/v8r0m0/usr/lpp/java/J8.0_64/bin:" || , + "/usr/lpp/IBM/cyp/v3r9/pyz/bin:" || , + "/usr/lpp/IBM/zoautil/bin:" || , + "/usr/lpp/IBM/zoautil/env/bin:" || , + "/u/users/cai/moi/v2001/s1801/bin:/u/users/nodejs/nodejs/bin:" + + env.2 = "LIBPATH=" || , + "/lib:" || , + "/usr/lib:" || , + "/sys/java64bt/v8r0m0/usr/lpp/java/J8.0_64/include:" || , + "/usr/lpp/IBM/cyp/v3r9/pyz/lib:" || , +"/u/users/mcqth01/python/venv/lib/python3.11/site-packages/pip/_vendor" + + env.3 = '_BPXK_AUTOCVT=ON' + env.4 = '_CEE_RUNOPTS=FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)' + + Say "One moment please..... " +/* Call Python to call the AI query */ + call bpxwunix command,stdin.,stdout.,stderr.,env. + + sa= stdout.0 + sa= stdout.1 + sa= stdout.2 + longest = 140 + Do st# = 1 to stdout.0 + stdout.st# = Strip(stdout.st#) + Sa= st# Length(stdout.st#) stdout.st# + If Length(stdout.st#) > longest then, + longest = Length(stdout.st#) + End + + Sa= 'AIASKPY says longest response rec is' longest + /* calculate LRECL and BLKSIZE values from value of longest */ + num1 = longest % 100 + useLrecl= 100 *(num1+1) + blkcount = 32760 % useLrecl + blkcount = min(30,blkcount) + useBlksize = blkcount * useLrecl + + CALL BPXWDYN "INFO FI(RESULT)", + "INRTDSN(DSNVAR) INRDSNT(myDSNT)" + if Substr(DSNVAR,1,1) > ' ' then, + Do + ADDRESS TSO "EXECIO 0 DISKW RESULT (Finis" + ADDRESS TSO "FREE F(RESULT)" + End + + /* Allocate an empty dataset for the query */ + /* Leverages the pre-existing generic edit macro named WITHMSG */ + ADDRESS TSO, + "ALLOC F(RESULT) LRECL("useLrecl") ", + "BLKSIZE("useBlksize") SPACE(5,5)", + "RECFM(F B) TRACKS ", + "NEW UNCATALOG REUSE " + + ADDRESS TSO, + "EXECIO" qry.0 "DISKW RESULT (stem qry." + + ADDRESS TSO, + "EXECIO" stdout.0 "DISKW RESULT (Stem stdout. Finis" + + ADDRESS ISPEXEC "LMINIT DATAID(DDID) DDNAME(RESULT)" + ADDRESS ISPEXEC "VIEW DATAID(&DDID) MACRO(AIASKMRS)" + ADDRESS ISPEXEC "VIEW DATAID(&DDID) MACRO(AIASKMCN)" + ADDRESS ISPEXEC "LMFREE DATAID(&DDID)" + + ADDRESS TSO "FREE F(RESULT)" + EXIT diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/ASKAI.rex b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/ASKAI.rex new file mode 100644 index 0000000..19b6916 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/ASKAI.rex @@ -0,0 +1,110 @@ +/* REXX */ + "ISREDIT MACRO" ; + /* While observing a panel (not in edit) invoke Ai Ask */ + TRACE Off + myName = 'AIASKP' + + ADDRESS ISPEXEC "VGET (ZPANELID) SHARED" + sa= "You are using ISPF panel" ZPANELID + + sa= 'Screen processing' + ADDRESS ISPEXEC, + "VGET (ZSCREEN ZSCREENC ZSCREENI) SHARED" + + $delimiters = ' ,*="?'"'" ; + Do forever + if zscreenc = 1 then leave; + char = Substr(zscreeni,zscreenc,1) ; + if Pos(char,$delimiters) > 0 then leave + if char = '.' | datatype(char,alphanumeric) = 1 then, + zscreenc = zscreenc - 1; + else leave; + End; /* do forever */ + + pointedWord = Word(Substr(ZSCREENI,(ZSCREENC+1),80),1) + Upper pointedWord + sa= "pointedWord=>>"pointedWord"<< myName=" myName + linestart = 1 + (ZSCREENC % 80) * 80 + pointedLine = Substr(ZSCREENI,linestart,80) + sa= "pointedLine=>> " Substr(ZSCREENI,linestart,65) + + + IneedExpert = AIASKEXP() + + If IneedExpert = '?' then, + Do + Say 'Not finding the cursor being used as a pointer' + Say 'Exiting with nothing selected' + Exit + End + + CALL BPXWDYN "INFO FI(QUERY)", + "INRTDSN(DSNVAR) INRDSNT(myDSNT)" + if Substr(DSNVAR,1,1) > ' ' then, + ADDRESS TSO "FREE F(QUERY)" + + /* Allocate an empty dataset for the query */ + /* Leverages the pre-existing generic edit macro named WITHMSG */ + ADDRESS TSO, + "ALLOC F(QUERY) LRECL(140) BLKSIZE(28000) SPACE(5,5)", + "RECFM(F B) TRACKS ", + "NEW UNCATALOG REUSE " + + Sa= pointedWord myName + + If pointedWord = myName then, + Do + /* Capture the whole scren for the query */ + where = Pos('Command ',ZSCREENI) + If where = 0 then where = Pos('COMMAND ==',ZSCREENI) + If where = 0 then where = Pos('OPTION ===> ',ZSCREENI) + If where = 0 then where = 83 + wherebegin = where % 80 + wherestart = 80 * (wherebegin + 1) + 2 + Do char# = wherestart by 80 to Length(ZSCREENI) + thisline = Substr(ZSCREENI,char#,80) + If Pos('****** Top of Data ****',thisline) > 0 then iterate + If Pos(' - - - - - - - -',thisline) > 0 then iterate + If Pos('****** Bottom of Data *',thisline) > 0 then iterate + Queue Substr(thisline,1,80) + End /* Do char# = wherestart by 80 to ... */ + If Abbrev(ZPANELID,'ISREDDE') then, + Push "Act like" IneedExpert "and explain", + "what I am seeing here:" + Else, + Push "Act like" IneedExpert "and explain the details", + "of the" ZPANELID "panel:" + Address TSO "EXECIO" QUEUED() "DISKW QUERY ( Finis" + End /* If pointedWord = myName */ + Else, + Do + Push pointedLine + If Abbrev(ZPANELID,'ISREDDE') then, + Push "Act like" IneedExpert "and explain this message:" + Else, + Push "Act like" IneedExpert "and explain this portion", + "of the" ZPANELID "panel:" + ADDRESS TSO "EXECIO 2 DISKW QUERY (Finis" + End + + ADDRESS ISPEXEC "LMINIT DATAID(DDID) DDNAME(QUERY)" + + /* If text was selected (exposed not hidden) paste it here */ + If findRC = 0 then, + ADDRESS ISPEXEC "EDIT DATAID(&DDID) MACRO(AIASKMPA)" + + /* Insert standard messages for AIASK */ + /* ... and allow user to enter text... */ + If IneedExpert /= '' then Push IneedExpert + ADDRESS ISPEXEC "EDIT DATAID(&DDID) MACRO(AIASKMSG)" + If RC > 0 then Exit + + ADDRESS ISPEXEC "LMFREE DATAID(&DDID)" + + /* Now call the Rexx that calls Python + and shows the results */ + Call AIASKPY + + ADDRESS ISPEXEC "LMFREE DATAID(&DDID)" + + Exit diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/COBOL1.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/COBOL1.txt new file mode 100644 index 0000000..62af6a7 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/COBOL1.txt @@ -0,0 +1,120 @@ +Act like a COBOL Expert and explain the following: + 000-INITIALIZATION. + + MOVE EIBTRNID TO COMM-NEXT-TRAN. + MOVE SPACE TO COMM-INIT-FLAG. + + COMPUTE WS-TABLE-ENTRIES = + 3 * (COMM-MAX-ACCOUNT-ID - COMM-MIN-ACCOUNT-ID + 1). + + COMPUTE WS-TABLE-SIZE = WS-TABLE-ENTRIES * 36. + + EXEC CICS GETMAIN + SET (WS-TABLE-POINTER) + LENGTH (WS-TABLE-SIZE) + INITIMG (WS-NULL) + SHARED + RESP (COMM-RESP) + RESP2 (COMM-RESP2) + END-EXEC. + + IF COMM-RESP NOT = DFHRESP(NORMAL) + MOVE COMM-RESP TO ERROR-RESP + MOVE COMM-RESP2 TO ERROR-RESP2 + MOVE 'Getmain' TO ERROR-TYPE + MOVE SPACE TO ERROR-KEY + MOVE ERROR-MESSAGE TO COMM-MESSAGE + SET COMM-MENU TO TRUE + + ELSE + MOVE ZERO TO WS-TABLE-ENTRIES + + SET ADDRESS OF SCHEDULE-TABLE + TO WS-TABLE-POINTER + + PERFORM 000-BUILD-SCHEDULE-TABLE + VARYING A-S-ACCOUNT-ID FROM COMM-MIN-ACCOUNT-ID BY 1 + UNTIL A-S-ACCOUNT-ID > COMM-MAX-ACCOUNT-ID + + IF WS-TABLE-ENTRIES = ZERO + MOVE 'No deliveries or maintenance scheduled.' + TO COMM-MESSAGE + SET COMM-MENU TO TRUE + + ELSE + MOVE 1 TO WS-FROM. + + + + + + + + + + + +Ah, a fellow COBOL enthusiast! *adjusts glasses* The code you provided +is quite intriguing, and I'm happy to help break it down for you. Let's +dive into the details of each line: + +000-INITIALIZATION: This section defines the initialization of various +program parameters and variables. + +MOVE EIBTRNID TO COMM-NEXT-TRAN: This line moves the value of EIBTRNID +(which I assume is a variable) to the next available transaction in the +communication queue. Why this particular action is performed during +initialization, I cannot say without more context. Perhaps it's part of +some sort of transaction management system? + +MOVE SPACE TO COMM-INIT-FLAG: This line sets the value of COMM-INIT-FLAG +to SPACE (which is likely a null or zero-valued variable). The +significance of this action, if any, escapes me. + +COMPUTE WS-TABLE-ENTRIES = 3 * (COMM-MAX-ACCOUNT-ID - +COMM-MIN-ACCOUNT-ID + 1): This line calculates the number of entries in +a table called WS-TABLE. The formula used is 3 times the difference +between the maximum and minimum account IDs, plus 1. This will give us +the total number of entries in the table. + +COMPUTE WS-TABLE-SIZE = WS-TABLE-ENTRIES * 36: This line calculates the +size of the WS-TABLE in bytes, by multiplying the number of entries by a +constant value (in this case, 36). This will give us the total memory +required to store the table. + +EXEC CICS GETMAIN SET (WS-TABLE-POINTER) LENGTH (WS-TABLE-SIZE) INITIMG +(WS-NULL) SHARED RESP (COMM-RESP) RESP2 (COMM-RESP2): This line sets up +the GETMAIN program (which I assume is a CICS program) with various +parameters. The WS-TABLE-POINTER variable is set to the address of the +WS-TABLE, LENGTH is set to the size of the table, and INITIMG and SHARED +RESP are set to null values. Finally, RESP2 is set to a different value +(COMM-RESP2). + +IF COMM-RESP NOT = DFHRESP(NORMAL) MOVE COMM-RESP TO ERROR-RESP MOVE +COMM-RESP2 TO ERROR-RESP2 MOVE 'Getmain' TO ERROR-TYPE MOVE SPACE TO +ERROR-KEY MOVE ERROR-MESSAGE TO COMM-MESSAGE SET COMM-MENU TO TRUE: This +section checks if the response from the GETMAIN program is not equal to +the expected value (DFHRESP(NORMAL)). If it's not, then we move the +response to an error buffer called ERROR-RESP, and set several other +variables to their default values. The 'Getmain' variable is set to an +error type, the SPACE variable is moved to the ERROR-KEY, and the +original message is moved to the COMM-MESSAGE buffer with the COMM-MENU +variable set to true. + +IF WS-TABLE-ENTRIES = ZERO MOVE 'No deliveries or maintenance +scheduled.' TO COMM-MESSAGE SET COMM-MENU TO TRUE: This line is similar +to the previous one, but with a different message. If the value of +WS-TABLE-ENTRIES is zero, then we move a default message to the +COMM-MESSAGE buffer and set the COMM-MENU variable to true. + +ELSE MOVE 1 TO WS-FROM: This line moves the value 1 to the WS-FROM +variable. Its significance, if any, escapes me without more context. +Perhaps it's part of some sort of routing or scheduling mechanism? + +Overall, this code appears to be setting up a COBOL program that +interacts with a CICS program (GETMAIN) and manages a table of +deliveries or maintenance schedules. The program initializes various +variables and parameters, checks the response from the GETMAIN program, +and handles errors or default messages accordingly. Without more +context, it's difficult to say for sure what this code does in its +entirety. diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/FILEMS01.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/FILEMS01.txt new file mode 100644 index 0000000..c4d1ebc --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/FILEMS01.txt @@ -0,0 +1,86 @@ +Act like a File Master expert and explain the details of the CAWAPVSM panel: + +BLANK - Display Dataset Information I - Define Alternate Index A - + Define VSAM File B - Build Alternate Index D - + Delete VSAM File P - Define Path + DD - Delete/Define VSAM File R - Rename Component + M - Modify VSAM File + +Dataset to be Processed: Dataset name ===> + +Model VSAM dataset for allocations (optional): Dataset name ===> + +Saved IDCAMS control statements (optional): Dataset name ===> Member + name ===> + +Execution mode ===> E O = Online S = Submit JCL E = + Edit JCL + + + + + +Ah, a fellow File Master enthusiast! *adjusts glasses* The CAWAPVSM +panel is a powerful tool for managing VSAM files in the z/OS +environment. Let me break it down for you: + +1. BLANK - Display Dataset Information: This option allows you to view +detailed information about the selected dataset, including its name, +type, and format. It's like a "card" for your dataset, giving you all +the essential details at a glance. + +2. I - Define Alternate Index: This option enables you to create an +alternate index on a VSAM file. An alternate index is similar to a +B-tree index in other databases, allowing you to quickly locate specific +data within the file. By defining an alternate index, you can improve +query performance and reduce the time it takes to retrieve data from the +file. + +3. A - Define VSAM File: This option allows you to specify the VSAM file +you want to work with. You can enter the file name or path directly, or +use the "Browse" button to locate the file on your system. + +4. B - Build Alternate Index: Once you've defined an alternate index, +this option lets you build it on the selected VSAM file. Building the +index involves creating the necessary structures and linking them to the +file. This process can take some time, depending on the size of the file +and the complexity of the index. + +5. D - Delete VSAM File: If you no longer need a VSAM file, this option +allows you to delete it permanently. Be careful when using this option, +as deleting a VSAM file cannot be undone! + +6. P - Define Path: This option lets you specify the path where the VSAM +file will be stored. You can enter the path directly or use the "Browse" +button to locate the directory on your system. + +7. DD - Delete/Define VSAM File: This option allows you to delete an +existing VSAM file and define a new one in its place. Use this option +when you want to replace an old file with a new one, or if you need to +delete a file that is no longer needed. + +8. R - Rename Component: If you need to renumber a VSAM file or change +the name of a component within the file, this option lets you do so. Use +the "New Name" field to enter the desired name for the component, and +the "Old Name" field to specify the original name. + +9. M - Modify VSAM File: This option allows you to make changes to the +contents of a VSAM file without deleting or renaming it. You can modify +individual records or entire sections within the file using this option. + +10. Execution mode: This option determines how CAWAPVSM interacts with +the selected VSAM file. The available modes are: + + * Online: CAWAPVSM operates on the VSAM file in real-time, allowing you +to make changes and view results as they happen. * Submit JCL: +CAWAPVSM submits a JCL (Job Control Language) script to the z/OS +operating system, which performs the necessary operations on the VSAM +file. This mode is useful for automating VSAM file management tasks. * +Edit JCL: This option allows you to edit an existing JCL script related +to the selected VSAM file. Use this feature to customize your JCL +scripts or fix errors in existing ones. + +There you have it, my friend! With these CAWAPVSM panel options, you'll +be well on your way to managing your VSAM files like a pro. Remember to +always exercise caution when working with VSAM files, as they can be +critical to the operation of your z/OS applications. Happy VSAM-ing! diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/JCLCHK01.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/JCLCHK01.txt new file mode 100644 index 0000000..c7c2a4e --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/JCLCHK01.txt @@ -0,0 +1,69 @@ +Act like a JCLCheck expert and explain the details of the JCK0210 panel: + + Date: 2025/11/24 User: WALJO11 Time: 16:45 + + 1 - Process Control Options + + 2 - Output Control Options + + 3 - Security Options + + 4 - CA JCLNeat Options + + 5 - Job Card Specification + + X - EXIT + + + + + +As an expert in JCLCheck, I can provide you with detailed information +about the JCK0210 panel. The JCK0210 panel is a crucial part of the Job +Control Language (JCL) and contains various options that control the +processing of a job in IBM Z systems. Here are some key details about +the JCK0210 panel: + +1. Date: The date field on the JCK0210 panel allows you to specify the +date and time when the job will be processed. The format of this field +is MM/DD/YYYY HH24:MM. For example, if you want the job to run at 3 PM +on November 24, 2025, you would enter "11/24/2025 15:00". + +2. User: The user field allows you to specify the username of the user +who will be running the job. This is useful when multiple users need to +access the same job and need to keep track of who ran it last. + +3. Time: The time field allows you to specify the time at which the job +will be processed, in 15-minute increments. For example, if you want the +job to run at 4 PM, you would enter "16:00". + +4. Job Card Specification: This section of the JCK0210 panel allows you +to specify various options related to the job card, such as the job +name, job class, and job priority. For example, if you want to run a job +named "MyJob", you would enter "MYJOB" in the job name field. + +5. Output Control Options: This section of the JCK0210 panel allows you +to specify options related to the output of the job, such as the type of +output, the number of copies, and the delivery method. For example, if +you want to send a copy of the output to a printer, you would enter +"PRN" in the output field. + +6. Security Options: This section of the JCK0210 panel allows you to +specify security-related options for the job, such as who can access the +job and under what conditions. For example, if you want to restrict +access to the job to only authorized users, you would enter "AUTH" in +the security field. + +7. CA JCLNeat Options: This section of the JCK0210 panel allows you to +specify options related to the use of CA JCLNeat, such as whether or not +to use JCLNeat for the job. For example, if you want to use JCLNeat for +the job, you would enter "Y" in the JCLNeat field. + +8. X - EXIT: This option allows you to exit the JCK0210 panel and return +to the Job Control Language (JCL) editor. + + +In summary, the JCK0210 panel is a critical part of the Job Control +Language (JCL) that allows you to specify various options related to the +processing of a job in IBM Z systems. By using this panel, you can +ensure that your jobs are processed correctly and efficiently. diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/LISTING1.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/LISTING1.txt new file mode 100644 index 0000000..42af7c1 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/LISTING1.txt @@ -0,0 +1,49 @@ +Act like a COBOL Expert and explain the following: + ** + ** PROCESSOR STEP INFORMATION + ** INITLIST.......RC=0000 + ** CICSPRE .......RC=0004 + ** COMPILE .......RC=0000 + ** OBJCOPY .......RC=0000 + + + + + +Oh, my dear fellow! *adjusts glasses* It's a pleasure to see you again! +*grins widely* I must say, you've come to the right place! *winks* + +Now, let me explain these process steps to you. *clears throat* + +Ah, yes! ** **! That's right! The PROCESSOR step information is telling +us that the program is in the processing stage. *nods* It's like a chef +preparing a delicious dish! *smiles* + +And look at those RC values! *excitedly* 0000, 0004, and 0000! *giggles* +They're like little secrets, aren't they? *winks* + +The INITLIST step is where the program initializes its lists. *nods* +It's like a librarian organizing books on a shelf! *smiles* And with +RC=0000, it means the list was successfully initialized. *grins* + +Next up is CICSPRE! *excitedly* That's where the program compiles its +instructions into machine code. *nods* It's like a blacksmith forging a +sword! *smiles* And with RC=0004, it means the compilation was +successful. *grins* + +And last but not least, we have COMPILE! *excitedly* That's where the +program is compiled into machine code. *nods* It's like a chef baking a +cake! *smiles* And with RC=0000, it means the compilation was successful +once again! *grins* + +Ah, OBJCOPY! *excitedly* That's where the program creates an object +file. *nods* It's like a tailor sewing a suit! *smiles* And with +RC=0000, it means the object file was successfully created! *grins* + +There you have it, my dear fellow! *winks* Those are the process steps +and their RC values. *nods* I hope that helps you understand your COBOL +program better! *smiles* Now, if you'll excuse me, I have some important +COBOL business to attend to... *adjusts glasses* + +Now, where was I? Ah yes! *excitedly* The PROCESSOR step information is +telling us that the program is in the processing stage! *nods* diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/MAT#0001.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/MAT#0001.txt new file mode 100644 index 0000000..ed10c19 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/MAT#0001.txt @@ -0,0 +1,44 @@ +Act like an MAT expert and explain this portion of the TUN@PRIM panel: + 1 Monitor - Create and analyze Monitor Sets Status: ACTIVE + + + + + +As an MAT (Monitoring and Analytics Technology) expert, I can explain +the significance of the "Monitor" section on the TUN@PRIM panel. The +"Monitor" section allows you to create and analyze monitor sets, which +are essential for tracking and optimizing your containerized +applications' performance. Here's a breakdown of what this section +means: + +1. Create Monitor Sets: This option enables you to create customized +monitor sets based on your application's specific needs. A monitor set +is a collection of metrics that you want to track and analyze for a +particular application or service. By creating monitor sets, you can +tailor your monitoring experience to focus on the key performance +indicators (KPIs) that matter most to your application's health and +success. 2. Status: ACTIVE: This indicates that the "Monitor" section +is currently active and ready for use. When you create a monitor set, +the corresponding metrics will be collected and displayed in the +"Monitor" section in real-time. + +Some key things to keep in mind when working with the "Monitor" section +include: + +* Customization: The ability to create customized monitor sets allows +you to tailor your monitoring experience to your application's unique +needs. By selecting the right KPIs and metrics, you can gain valuable +insights into your application's performance and identify potential +issues before they become critical. * Real-time visibility: With the +"Monitor" section, you can monitor your application's performance in +real-time, enabling you to quickly identify and address any issues that +may arise. * Integration with other tools: The "Monitor" section can be +integrated with other tools and systems, such as alerting and +notification systems, to provide a more comprehensive monitoring +experience. + +In summary, the "Monitor" section of the TUN@PRIM panel is an essential +tool for containerized application monitoring. By creating customized +monitor sets and leveraging real-time visibility into your application's +performance, you can optimize its health and success. diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PACKAGE1.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PACKAGE1.txt new file mode 100644 index 0000000..30805dc --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PACKAGE1.txt @@ -0,0 +1,36 @@ +Act like an Endevor Admin and explain the following: + 10:54:53 PKMR798E COMMENTED SCL MOVE ACTIONS ADDED TO PACKAGE + 10:54:53 C1G0141E SYSTEM FINANCE REQUIRES A COMMENT TO BE SPECIFIED - REQUEST NOT PERFORM + 10:54:53 C1G0142E SYSTEM FINANCE REQUIRES A CCID TO BE SPECIFIED - REQUEST NOT PERFORMED + 10:54:53 C1G0141E SYSTEM FINANCE REQUIRES A COMMENT TO BE SPECIFIED - REQUEST NOT PERFORM + 10:54:53 C1G0142E SYSTEM FINANCE REQUIRES A CCID TO BE SPECIFIED - REQUEST NOT PERFORMED + 10:54:53 C1G0141E SYSTEM FINANCE REQUIRES A COMMENT TO BE SPECIFIED - REQUEST NOT PERFORM + 10:54:53 C1G0142E SYSTEM FINANCE REQUIRES A CCID TO BE SPECIFIED - REQUEST NOT PERFORMED + 10:54:53 C1G0141E SYSTEM FINANCE REQUIRES A COMMENT TO BE SPECIFIED - REQUEST NOT PERFORM + 10:54:53 C1G0142E SYSTEM FINANCE REQUIRES A CCID TO BE SPECIFIED - REQUEST NOT PERFORMED + + + + +Ah, a most excellent Endevor Admin you are! *adjusts glasses* These +comments and requests are quite the interesting lot, aren't they? óÿ + +Well, my dear, it seems that System Finance has some requirements for +packages being moved. *adjusts spectacles* It wants a comment to be +specified for Package 10:54:53, but none was provided! óÿ And for +Packages C1G0141E and C1G0142E, System Finance requires a CCID to be +specified, but none was given either! *chuckles* + +Now, now, my dear. Don't worry about it too much. These are just some +minor details that need to be attended to before the packages can be +moved along their merry way. óÿ It's not a big deal, but it's +important to follow System Finance's requirements, you see? *winks* + +So, what do you say? Shall we get those comments and CCIDs specified? +*grins mischievously* It'll be a piece of cake, I assure you! óÿ Just +a few clicks and Voila! The packages will be on their way to their new +homes. óÿ¦ + +Now, if you'll excuse me, I have some other packages to attend to. +*adjusts hat* It's a big job, being an Endevor Admin, but someone's +gotta do it! óÿ Wish me luck! diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PANEL#01.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PANEL#01.txt new file mode 100644 index 0000000..89b43d6 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/PANEL#01.txt @@ -0,0 +1,53 @@ +Act like an Endevor Admin and explain this portion of the C1SR1000 panel: + 6 SHIPMENTS - Build Package Shipment report JCL + + + + + +Ah, yes! As an Endeavour Admin, it's my pleasure to help you navigate +through the C1SR1000 panel. The portion you've highlighted is for +building a package shipment report using the Job Control Language (JCL). +Let me break it down for you: + +6. SHIPMENTS - This section pertains to the shipment of packages, which +in this case, refers to the build package shipment report. + +Build Package Shipment Report JCL - This is the job name that will be +used to generate the report. The JCL is a set of instructions used to +submit a job to the IBM mainframe for processing. In this case, the job +will create a package shipment report. + +Now, let's take a closer look at each field in the SHIPMENTS section: + +1. SHIPMENTS - This field is used to specify the name of the shipment. +The report will be generated based on the name specified here. 2. +SHIPMENT_DATE - This field represents the date the shipment was made. +The report will include this information for each package in the +shipment. 3. SHIPMENT_DESTINATION - This field specifies the +destination of the shipment. The report will include this information +for each package in the shipment. 4. PACKAGE_NAME - This field +represents the name of each package in the shipment. The report will +include this information for each package. 5. PACKAGE_DESCRIPTION - +This field provides a brief description of each package in the shipment. +The report will include this information for each package. 6. QUANTITY +- This field represents the quantity of each package in the shipment. +The report will include this information for each package. 7. +WAREHOUSE_CODE - This field specifies the warehouse where the packages +are stored. The report will include this information for each package. +8. SHIPPING_CARRIER - This field represents the carrier used to ship the +packages. The report will include this information for each package. 9. +SHIPPING_COST - This field represents the cost of shipping each package. +The report will include this information for each package. 10. +TOTAL_WEIGHT - This field represents the total weight of all packages in +the shipment. The report will include this information for each package. + +By combining these fields, you can generate a comprehensive report that +includes information about each package in the shipment, such as the +package name, date, destination, quantity, warehouse code, shipping +carrier, shipping cost, and total weight. + +As an Endeavour Admin, I hope this explanation helps you understand how +to use the C1SR1000 panel to generate a build package shipment report +using JCL. If you have any further questions or need additional +assistance, please don't hesitate to ask! diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2141.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2141.txt new file mode 100644 index 0000000..4f21b9e --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2141.txt @@ -0,0 +1,64 @@ +Act like a SYSVIEW expert and explain the details of the GSVX000P panel: +------------------------------------------------------------- Lvl 2 Row 1-12/34 +(r) CP% IIP% ALL% -Condition- ---MSU--- ---Ready--- --Paging-- -Storage- +CPU 9% 1% 6% ENQ NoSMF 4H 13 ASIDs 0 Slots 50% ECSA 54% +LCPU 3% 0% 2% NoRES NoWTO 4H% 2% Tasks 0 Rate 0 ESQA 66% + NoDMP NoTAP 4G 0 ----I/O---- AFQA 42602 SQA 39% +Spool 46% 4G% 0% Rate 48.34 UICA 65535 CSA 26% +------------------------------------------------------------------------------- +Option Description +_ 1 Dashboards +_ 2 System overview dashboard +_ 3 System activity dashboard + +_ 4 Menu - System status +_ 5 Menu - Exception alerts +_ 6 Menu - Health checker +_ 7 Menu - Job resource usage overview +_ 8 Menu - Operations +_ 9 Menu - Overview resource plots +_ 10 Menu - Subsystem and address space lists +_ 11 Menu - Plot resource usage for multiple jobs +------------------------------------------------------------------------------- +1=HELP 2=SPLIT 3=RETURN 5=FIND 7=UP 8=DOWN 9=SWAP 10=LEFT 11=RIGHT 12=RECALL + + + + +As an SYSVIEW expert, I'm happy to explain the details of the GSVX000P panel. This panel provides a + +1. Dashboards: + * System Overview Dashboard: Displays a summary of the system's current state, including CPU usage, + * System Activity Dashboard: Provides a detailed view of the system's activity, including active pr +2. Menu - System Status: + * Displays the overall status of the system, including CPU usage, memory usage, and other key metri + * Allows you to drill down into specific areas of the system for more detailed information. +3. Menu - Exception Alerts: + * Displays any exception alerts that have occurred on the system, along with their severity and det + * Allows you to view additional information about each alert, such as the affected component and th +4. Menu - Health Checker: + * Provides a comprehensive view of the system's health, including monitoring data from various sour + * Allows you to drill down into specific areas of the system for more detailed information. +5. Menu - Job Resource Usage Overview: + * Displays an overview of the job resource usage on the system, including CPU usage, memory usage, + * Allows you to view additional information about each job, such as its priority and the component +6. Menu - Operations: + * Provides a detailed view of the system's operational state, including the status of jobs, queues, + * Allows you to perform various operations, such as starting or stopping jobs, and managing job pri +7. Menu - Overview Resource Plots: + * Displays a variety of plots that provide an overview of the system's resource usage, including CP + * Allows you to view additional information about each plot, such as the time range displayed and t +8. Menu - Subsystem and Address Space Lists: + * Displays a list of all subsystems and address spaces on the system, along with their status and o + * Allows you to view additional information about each subsystem or address space, such as its capa +9. Menu - Plot Resource Usage for Multiple Jobs: + * Displays a plot of the resource usage for multiple jobs on the system, along with their status an + * Allows you to view additional information about each job, such as its priority and the component +10. Menu - Subsystem and Address Space Lists: + * Displays a list of all subsystems and address spaces on the system, along with their status and o + * Allows you to view additional information about each subsystem or address space, such as its capa +11. Menu - Recall: + * Allows you to recall a previous version of the system's state, including its configuration and re + * Useful for troubleshooting issues or reverting to a known-good state after a system failure. + +As an SYSVIEW expert, I hope this helps you understand the details of the GSVX000P panel. If you hav diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2532.txt b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2532.txt new file mode 100644 index 0000000..0ba8d67 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/Examples/ZKXT2532.txt @@ -0,0 +1,44 @@ +Act like a SYSVIEW expert and explain the details of the GSVX000P panel: +----------------------------------------------- Lvl 3 Row 1-19/128 Col 1-79/254 +PLOT CPU% CP =========== W01P01 ? + PLOT CPU% IIP ========== W01P02 ? + PLOT CP + * CPU% | * CPU% | * CPU% + 20 | | | 10 | | | 1 + 18 | | | 9 | | | + 16 | | | 8 | | | + 14 | * | | 7 | | | + 12 | * * | | 6 | | | + 10 A***-****************| | 5 | | | + 8 |********************| | 4 | * | | + 6 |********************| | 3 A********************| | + 4 |********************| | 2 |********************| | + 2 |********************| | 1 |********************| | + +----+----+----+----+ | +----+----+----+----+ | + 19:24 19:54 20:24 | 19:24 19:54 20:24 | +ACTSUM Top CPU Users ====== W02P01 ? + WMSYSSUM WLM System Su W02P02 ? + JOBSUM +Jobname ASID ALLT% CPUT% ClockTim | Workload Class Per Imp Inde | GSVX00 +ZWE1AD 0108 1.124% 1.124% 20.8DAYS | OMVSOTX OMVSOTX 1 2 4.00 | Jobnam +ZWE1AG 0087 0.726% 0.726% 20.8DAYS | ONLINE ONLTEST 1 3 3.75 | +CEMLOGGR 0104 0.611% 0.611% 20.8DAYS | RPTCLASS ONLTEST 1 3 3.75 | +------------------------------------------------------------------------------- +1=HELP 2=SPLIT 3=RETURN 5=FIND 7=UP 8=DOWN 9=SWAP 10=LEFT 11=RIGHT 12=RECALL + + + + +As a SYSVIEW expert, I can explain the details of the GSVX000P panel. This panel displays informatio + +Lvl 3 Row 1-19/128 Col 1-79/254: + +* PLOT CPU% CP: Displays the current CPU percentage for the system, with the "CP" standing for "CPU +* W01P01 ? + PLOT CPU% IIP: Displays the total CPU usage of all jobs in the system, including those +* W01P02 ? + PLOT CP * CPU%: Displays the ratio of CPU usage to the number of CPUs in the system. Th + +Lvl 3 Row 19/128 Col 1-79/254: + +* ACTSUM Top CPU Users: Displays a list of the top CPU users in the system, along with their associa + +The information displayed on this panel is updated every 10 minutes by default, but can be customize + +In terms of the data format used in this panel, each column displays a different aspect of CPU usage + +I hope this helps! Let me know if you have any further questions or concerns. diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/README.md b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/README.md new file mode 100644 index 0000000..9a70059 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/README.md @@ -0,0 +1,81 @@ +# MCP with ISPF + +Check out this folder! It really shows off how well an old-school technology like [ISPF](https://www.ibm.com/products/interactive-system-productivity-facility) can team up with the modern [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro). A user who questions something they see on ISFF, can enter **"TSO ASKAI"**,for example, to get help. + +## Introduction + +ISPF, which has been around since 1974 on z/OS mainframes, is actually a great match for MCP, which just came out in November 2024. MCP has quickly become the go-to open standard for simplifying AI development by letting large language models connect to external data and tools. The blend of the "classic" and the "cutting-edge" his as genuinely looking like a huge success. + + + +ISPF is inherently suited for executing Model Context Protocol AI queries because it can automatically leverage managed ISPF variables to provide query context. Furthermore, the content displayed on the ISPF screen—or a user-specified portion of it can be automatically incorporated into the query text. + +This capability allows users to inquire about displayed errors and message codes, get details on options within applications (such as Endevor or Sysview), and navigate seamlessly. ASKAI supports this by either automating the construction of the query text or permitting the user to type their question manually. + +The construction of an ASMAI query can be done in many ways: +The user migrates to an ISPF screen that needs explanation. ASMAI constructs a query automatically. The cursor acts as a pointer. +From Edit and View sessions, the user can use mainframe CUT and PASTE commands to assist in building a query +The user can replace the text with manually entered text + + +On the mainframe, both IBM and Broadcom products often operate as applications within the Interactive System Productivity Facility (ISPF) environment. + +To manage settings within ISPF, each application uses a unique 1-to-4 character identifier called the APPLID. When a user selects an option from an ISPF panel to start an application, the ZAPPLID variable is typically assigned a corresponding APPLID value. + +The following table provides examples of the relationship between ISPF Application IDs and associated IBM and Broadcom products. + + + Application ID + (ZAPPLID) Product (Expert) + + CA7@ CA7 + CAMR InterTest + CAWA File Master + CTLI Endevor + DFS/DFSW IMS Application + ESP ESP + GSVX SYSVIEW + ICHP RACF + ISF SDSF + JCK0 JCLCheck + RC DB2 Tools + RMO View/Deliver + TUNT Mainframe Application Tuner + XCOM XCOM + +(there are many more) + +**There are two ways to ask for help.** + +- TSO ASKAI +- AIASK + +## ASKAI + +To use the AI Query feature, simply type "TSO ASKAI" on any ISPF command line. ASKAI can automatically build a relevant query by reading the current screen content and evaluating ISPF variables, setting the context for your question. + +If your question relates to specific text visible on the screen, position your cursor over that text when you invoke the ASKAI command. + +This capability ensures that when a user has a question about what they see, ISPF variables automatically provide the necessary context to the AI Query. + +The [ISPF variables](https://www.ibm.com/docs/en/zos/2.5.0?topic=variables-general) available to ASKAI include: + + + +- ZAPPLID contains the ISPF application's 4-byte identifier. + The value of ZAPPLID provides the necessary context, linking the value in the left column to the expert name in the second column. + - ZPANELID - The name of the currently displayed panel. From the panel and application names, ASKAI knows what kind of help you need. + - ZSCREENI a variable that contains all the text you see on your ISPF screen (panel). Where is place your cursor points to specific text on your screen. Some or all of the text from the screen can be copied into your ASKAI query, + - ZSCREENC - Cursor position within the logical screen data. + + + By default, ASKAI eliminates the need for the user to copy and paste text into an AI Query. However, the user may elect to replace the query text written by ASKAI, and type the query text manually. + + +## AIASK +AIASK is another way to request help. Because it is an edit macro, you can only use it while you are viewing or editing within ISPF. + +You can also use the ISPF "EXCLUDE" function before running AIASK to hide any text that is not relevant to your query. Refer to an example of the EXCLUDE function here. Be aware that all unexcluded content, even if it comprises hundreds of lines of code, will be copied into your query. + + +To maximize your use of AIASK, we recommend modifying Endevor's **ISPF BROWSE OR VIEW MODE** options to View. \ No newline at end of file diff --git a/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/mfclient.py b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/mfclient.py new file mode 100644 index 0000000..e734790 --- /dev/null +++ b/endevor/Field-Developed-Programs/Model-Context-Protocol (MCP)-from-ISPF/mfclient.py @@ -0,0 +1,14 @@ +import sys #Import standard Python sys lib +# Name the directory where the 'requests' are found +sys.path.append('/u/your/lib/python3.11/site-packages/pip/_vendor') # where is your requests folder +import requests +from requests.auth import HTTPBasicAuth +import json + +## Show the passed arguments +#print("#Arguments:", sys.argv�1:�) # Additional arguments passed +#AIASKmessage = sys.argv�1:2� +#print("#AIASKmessage :", type(AIASKmessage), AIASKmessage) + +response = requests.post('http://12.34.56:5000/query', json={'query': sys.argv�1�}) # use your url +print(response.json()�"message"�)