RXMON

RXMON
RXMON Screen

RXMON Screenshot

RXMON Screenshot
RXE (a editor)

terça-feira, 6 de janeiro de 2009

RXMON (alpha)

What is RXMON ?

RXMON is a project to mix a lot of concepts from Mainframe and Unix/Windows platforms.It is a deamon, like a telnetd from Unix. It runs Rexx and COBOL workload but it uses TN3270 for online transactions/application. All tasks runs in threadsafe mode using PThread POSIX model.

He can be used either as a deamon, providing access by terminal emulator or when we need to run a batch REXX scripts (like a long process). For this cases we have two differents engines, "zrx" as a interpreter and "zssss" as a server.

Nowadays I am the mainly user of RXMON.

I have a great passion by TSO, REXX, CMS, VM and ISPF, and of course, 3270 protocol, emulators, green screens..... I tried to implement some pieces from known program products in RXMON. (I will show some examples) I have a couple of JCL and transactions in my lab to improve procedures and tasks, like backup/restore, send/receive emails, to collect data using 3270 panels, code generators, file transfers....

Who had a chance to work with CICS/IMS/CMS or TSO will be able to compare RXMON with them. It is a mix from them. But we can forget that basically is a monitor to run infrastructure applications or business transactions.

Where can we use RXMON?

- production applications, to improve data entry (no mouse! no graphical slow interfaces!)


- scheduler tasks


- Mainframe migrations, emulating CICS or IMS transactions, JCL and other mainframe concepts


- Development teams, when we need to save CPU consuption by TSO and edit/compile/test procedures (just using to mainframe to run applications)



Features from version 1.0 (alpha) :


- Running under Windows (CYGWIN) or Linux


- TN3270 traffic to use emulator terminals (like PCOM, EXTRA, x3270)


- portable to use Regina REXX (REXXSAA)


- support to use MYSQL clients, directly from REXX- internal SQLite support to manage product database or application data (like a VSAM to MVS)


- TCPIP support and CURL interface (TCPIP protocols support)


- provided a DSS subsystem as a REXX Host Command Interface

- OpenCobol support (see http://www.opencobol.org/ )


Please, let me know if you have comments or doubts about this product.


DSS Host Command Summary :



- CONVERSE send/reveive a 3270 datastream to terminal



- EXECIO <*n> DISKWAR (STEM stem FILTER label like a TSO EXECIO with some improvements like FILTER callback and DISKA, for append feature



Example :
In this sample, you can select which records will be loaded to STEM variable or stack area.

say 'mode='execmode()
dados='/home/gaeta/sss/arq2.txt'

'execio * diskr dados (stem ll. filter selectrec'

say 'rc='rc

say 'total='ll.0

do i=1 to ll.0

say i'->'ll.i

end

exit

selectrec: parse arg act,rec

rec=strip(rec)

execio='NOREAD'

if substr(rec,1,2)='11' then execio='READ'

return



- PANEL show a map in a based NCurses terminal from STEM map variable


- MAP <*vsocket> like a PANEL command, but send/receive a map to/from TN3270 terminal


- REFRESH ?


- CBTASK to start a OC Cobol task


- LIST INS SELECT LOADFILE SAVEFILE DEL COUNT GET ADD DESTROY
to manage linked lists.


- BROWSE DEFINE REFRESH UPDATE NEXT PREV RESET
to manage browse resource in 3270 panels SYSRETR
to extract system variables


- DBOPEN file DBCLOSE
to open/close user databases (MYSQL and SQLite supports)


- DBSQL qualif SQLCODE SQLROWS SQLRECS SQLMSG SQLRESULT
to run queries and returns SQL fields retrieved into REXX variable as STEM model.
Example :


'dbopen test.db'

var1="select * from tab1"

'set sqlline field'

'dbexec var1'

say 'sqlrecs=' sqlrecs

do i=1 to sqlrecs

say cod.i substr(nome.i,1,40) fone.i

end

'dbclose test.db'

exit


- DBEXEC SYSEXEC
to run SQL DML commands


- SYS qualif SQL
like a DBSQL command, but runs a query from IPD (Internal Product Database)



- SHOW flush a output data


- RXTHREAD to start a new REXX thread - DUMP to DUMP internal structures, used to debug data


- GLOBALV CLEAR PUSH ... POP ... to interchange Rexx variables between programs, you can PUSH variables to Rexx called and restore using POP parameter.


- LOG sysid sysappl msgclass internal LOG structure


- SPOOL OPEN CLOSE PURGE sysid jobid
to manage spool data, used by JCL feature or application/transactions. You can interchange spool data from online to batch scripts


- SPWRITE sysid jobid jobstep jobfile SPREAD sysid jobid jobstep jobfile
write/read record to/from spool


- PERFORM lbl1,lbl2...lbln
call Rexx internal procedures


- DEF BEGIN 1 n-lvl * ... END LIST
to manage records, using to COBOL record concepts


"SET" commands :


SET SYSTEM $USERID $SYSID $SUPER OFFon
sets internal data


SET OUTMODE OFFon
?


SET MAPDELAY OFF0-milisec
sets a delay for each receive map


SET MAPCASE UcaseMixed
force a uppercase in data map


SET FEATURE offon
load a lot of features to BATCH Rexx script


SET SQLLIM NOmaxrecs
sets a number max record to ceate a STEM variables using to DBSQL or SYS commands


SET SQLEXT OFFon
sets a SQL extensions on or off, to bring Rexx procedures as SQL SELECT functions.
Example :
'set sqlext on'
esql="attach database 'test.db' as test"'sysexec esql'
var1="select vardata,rxproc('ff1',varname,'f') as x from sssreg"'sys var1 var1_field.'say 'sqlresult=' sqlresultsay 'sqlmsg=' sqlmsg
do i=1 to sqlrecs say vardata.i 'x=' x.iendsay 'sqlrecs=' sqlrecs
if execmode()='BATCH' then do 'set feature off'end
exit
ff1: parse arg p1,p2 say 'p1=' p1 ' p2=' p2 sqlexpr='$'p1'$'return


SET SQLPROC onOFF
sets a Rexx procedure as a record callback from SQL SELECT command.
Example :
'dbopen test.db'say 'dbopen rc='rc
'set sqlproc to each_record'esql='select * fxom tab1''dbsql esql ff.'do i=1 to ff.0 say i'='ff.iend
'dbclose test.db'say 'dbclose rc='rc
exit
each_record: parse arg p1,p2 say 'p1='p1 say 'p2='p2return


SET DEBUG OFFon
sets a debug on/off to DSS commands


SET SQLLINE compactFIELD
sets a type of output record from SQL SELECT commands compact - all fields will be concat in a one field field - each field will be a STEM


SET CURSOR NORMAL,UNPROT BRIGHT,UNPROT NORMAL,ASKIP BRIGHT,ASKIP DARK BLINK NORMAL,REVERSE ULINE,NORMAL ULINE,BRIGHT
sets a map field attribute


SET MAPEVENT OFFon,procedure
sets a map events on/off


SET KEY PFx,label,vcmd
sets a command to PFxx


Built-in :


E2A(ebcdic-string), converts ebcdic to ascii


A2E(ascii-string), converts ascii to ebcdic


LITEM(,), retrieve a item from linked list pointed by


LCOUNT(), count a linked list items


SEARCH('stem',vstr,istart,iend), search in a STEM variable, using vstr argument, from to item


REMOVE(vname), ?


EXECMODE(), returns ONLINE or BATCH mode


STORAGE(ioffset,ibytesread,), to manage Rexx task storage (about 32K)


SERVICE('SET',vsysid,vgroup,vname,vdata), to manage internal registry 'GET',vsysid,vgroup,vname 'DEL',vsysid,vgroup,vname


RECORD('P',,), to manage Rexx Record Structure 'G',
Variables :


ZCURSOR


ZSOCKET


ZFIELDS


ZMAPOUT


ZMAPIN


ZDEBUG


ZSQLLINE


ZOUTMODE


ZSYSID


ZMAPCASE


ZBRWBND1


ZBRWBND2


ZBRWCSR


ZBRWPAGE


ZTEST


ZTESTID


ZUSER


ZSUPER


ZMAPDELAY


ZMAPUCASE


Customize utilities :



rxb.rexx - a browse routine


rxe.rexx - a edit routine


rxf.rexx - a file list routine


rxq.rexx - a queue routine

domingo, 20 de julho de 2008

Tools

RXMEM Rexx package
A new package to manage linked list in REXX language. There are a couple functions to manage lists, like, add an item to end of list, insert an item between items, remove an item from list, load from stem variable, save to stem variable, to manage a token pair feature from MVS and obtain/release memory.

An example :

Linked list sample :

/* REXX */
"ISPEXEC LIBDEF ISPLLIB DATASET ID ('DFGAETA.LOAD') UNCOND"
SAY 'CREATING TWO LINKED LISTS'
RC=RXMEM('CREATE','L1')
RC=RXMEM('CREATE','L2')
SAY 'ADDING TO END OF LIST'
DO I=1 TO 15
RC=RXMEM('ADD','L1','ITEMS IN LIST L1 #'I)
END
SAY 'ADDING TO END OF LIST USING STEM VARIABLE'
L2.1='ITEM CREATED IN STEM L2 #1'
L2.2='ITEM CREATED IN STEM L2 #2'
L2.3='ITEM CREATED IN STEM L2 #3'
L2.4='ITEM CREATED IN STEM L2 #4'
L2.5='ITEM CREATED IN STEM L2 #5'
L2.6='ITEM CREATED IN STEM L2 #6'
A=RXMEM('LOADSTEM','L2',D2C(1,4),D2C(6,4))
SAY 'COUNTING ITEMS IN LINKED LIST'
SAY 'ITEMS IN L1='RXMEM('COUNT','L1')
SAY 'ITEMS IN L2='RXMEM('COUNT','L2')
SAY 'LISTING L1 LINKED LIST'
DO I=1 TO RXMEM('COUNT','L1')
SS=STRIP(RXMEM('GET','L1',D2C(I,4)),'T')
SAY 'ITEM #'I' STR='SS
END
SAY 'LISTING L2 LINKED LIST'
DO I=1 TO RXMEM('COUNT','L2')
SS=STRIP(RXMEM('GET','L2',D2C(I,4)),'T')
SAY 'ITEM #'I' STR='SS
END
SAY 'DELETING SOME ITEMS FROM L2'
A=RXMEM('DEL','L2',D2C(2,4))
SAY 'LISTING L2 LINKED LIST AFTER DELETE ACTION'
DO I=1 TO RXMEM('COUNT','L2')
SS=STRIP(RXMEM('GET','L2',D2C(I,4)),'T')
SAY 'ITEM #'I' STR='SS
END
SAY 'DELETING SOME ITEMS FROM L2'
A=RXMEM('DEL','L2',D2C(4,4))
SAY 'LISTING L2 LINKED LIST AFTER DELETE ACTION'
DO I=1 TO RXMEM('COUNT','L2')
SS=STRIP(RXMEM('GET','L2',D2C(I,4)),'T')
SAY 'ITEM #'I' STR='SS
END
SAY 'INSERTING TWO ELEMENTS TO L1'
A=RXMEM('INS','L1',D2C(3,4),'ADDITIONAL ITEM #1')
A=RXMEM('INS','L1',D2C(4,4),'ADDITIONAL ITEM #2')
DO I=1 TO RXMEM('COUNT','L1')
SS=STRIP(RXMEM('GET','L1',D2C(I,4)),'T')
SAY 'ITEM #'I' STR='SS
END
A=RXMEM('DESTROY','L1')
A=RXMEM('DESTROY','L2')
EXIT

Obtain/Release memory :


/* REXX */
"ISPEXEC LIBDEF ISPLLIB DATASET ID ('DFGAETA.LOAD') UNCOND"
ADDR=C2X(RXMEM('OBTAIN',D2C(2048,4)))
SAY 'STORAGE OBTAIN ='ADDR
SAY 'MOVING TO ADDRESS'
XZ=STORAGE(ADDR,20,'1234567890ABCDEFGHIJ')
SAY 'LOADING FROM ADDRESS'
SAY STORAGE(ADDR,20)
SAY 'STORAGE RELEASE ='RXMEM('RELEASE',X2C(ADDR),D2C(2048,4))
EXIT

A token-pair feature :


/* REXX */
"ISPEXEC LIBDEF ISPLLIB DATASET ID ('DFGAETA.LOAD') UNCOND"
AA=RXMEM('TKCRT','PAIR1 DATA ONE ')
/* 12345678901234561234567890123456 */
AA=RXMEM('TKCRT','PAIR2 DATA TWO ')
/* 12345678901234561234567890123456 */
SAY 'PAIR1=' RXMEM('TKRTV','PAIR1 ')
SAY 'PAIR2=' RXMEM('TKRTV','PAIR2 ')
EXIT


Powerful JCL Preprocessor
This is my favorite tool. RXJCL is a preprocessor to expand cards from JCL, before a JES submission.
It is powerful to build JCL usings REXX variables, expressions and macro procedures.

Example :

In this example, we have a JCL using %%SCAN macro expansion and %%REPEAT-%%EREPEAT command. All %% strings will be processed by RXJCL.

//* %%OUT LST
//JOBTST JOB (ACCT),CLASS=A
//STEP01 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
//* %%SCAN DSN TEST.CT.** LSTDSN
//* %%REPEAT LSTDSN.0 IDX
DELETE %%(LSTDSN.IDX) NONVSAM
//* %%EREPEAT

In summary, it can be a excelent tool for Production procedures, like as dataset movements, PDS members process, JCL builds using PDS directory, datasets from catalog, records from sequential datasets...

Rexx Frontends for TERSE and UNTERSE

This is a tool to manage a frontend to TRSMAIN utility.
There are two REXXs, for terse and unterse processes. It can be used in ISPF 3.4 option, directly in dataset line, in prefix/command area.

The key point is unterse process, it get a DCB from tersed dataset and allocate an output dataset using it.


Fullscreen interface using REXX without ISPF
RX3270 is a fullscreen interface to use with REXX language.

It uses TPUT and TGET macros and is a good tool to make fullscreens using 3207 datastream.

It works with two areas, an input area with datastream and an output area with inputed data besides an additional area with expcetion key, like PFxx, PAx, ENTER or CLEAR.

I am using IKCT441 service to manage REXX/CLIST variables using external languages. A good sample for who is researching about it.


Interface to SMP GIMAPI using REXX
RXGIMAPI is just a interface to use GIMAPI (SMP/E) with REXX language.

I used IKTCT441 service to build parameters through rexx variables.

RXGIMP will process output using SYSPRINT ddname under TSO/F or batch.




(Obs. Please, look at http://www.cbttape.org/ , maintened by Sam Golob and others)

Red Monster! Across any place!

Red Monster! Across any place!

My sister... Rafting moment

My sister... Rafting moment

Perfect day... Night rafting

Perfect day... Night rafting

Still a perfect day...

Still a perfect day...

A fun moment

A fun moment

Happy couple!

Happy couple!

Wife, mother and sister

Wife, mother and sister

My brother-in-law

My brother-in-law

Making X-Burgers with my father

Making X-Burgers with my father

My paradise....

My paradise....

My paradise

My paradise

The BIG GRANDMA!

The BIG GRANDMA!

My parents... A long long marriage!

My parents... A long long marriage!

Wife and my godparents!

Wife and my godparents!

Gaeta's couple duet

Gaeta's couple duet

Personal

Personal
Enjoying the life!

Teaching...

Teaching...
Teaching my dog to go for a swim