HomePage | RecentChanges | EditorIndex | TextEditorFamilies | Preferences

 SPF/SE for Windows emulates the mainframe SPF editor

 Author:    Command Technology
 HomePage:  http://www.commandtechnology.com/
 Family:    IbmEditorFamily MainframeEditorFamily
 License:   Commercial
 Platform:  Windows (Available in console mode and graphics versions)

SFP/SE is a powerful editor and file manager that emulates the IBM mainframe ISPF editor. Two versions are provided; standard which uses a command interface closest to ISPF or SPFPC and graphic which uses windows menus and dialogs. Editor line commands are the same.

While the visual appearance of SPF/SE is similar to that of ISPF, it is missing important parts of the ISPF environment, including REXX support. -- SJMetz

Previous versions of SPF (SPFPC 3-5) supported IBM ISPF panels, dialogs and variables using IBM REXX/2 as the macro/scripting language. SPF/SE 1-8/365 provides its own dialog manager, dialog definition language and a C-like macro/scripting language that is easy to learn and use.

A small script in SPF/SE can call any REXX interpreter for text processing (or BASIC, PHP, Powershell, etc.) as well as invoking SPFPC dialogs by calling older SPFPC versions (3-5).

Example 1:

    Sends contents of string to REXX interpreter. Returns result.
    If 0 is returned, operation was not successful!
    EXAMPLE: rexxservice("cmd","xrange('a','z')' 'xrange('A','Z')");
             rexxservice("cmd"," X2B('7') ");
             rexxservice("cmd"," date('n') ");
             rexxservice("cmd"," 'DATE = 'date('n')' TIME ='time('n') ");
             rexxservice("cmd"," FORMAT('54372.845',8,2) ");
             rexxservice("exec","h:\\u\\spfpc40\\macros\\h3.spf cmd words");
             Just remember about command line character limitations ie <> | etc.
             Change rexxpath to point to your REXX interpreter
char rexxservice(char *xopt, char *x){
  char *xfins = "c:\\temp\\dret.ins";
  char *xfret = "c:\\temp\\dret.ret";
  char *rexxpath = "c:\\ooRexx\\rexx.exe ";      //OOREXX Interpreter
  int xhin;
  int xhret;
  char *tr;
  char *td;
  char *xret = "OK";
  char *tcmd;
  if(xopt == "cmd"){
    tr = filedelete(xfret);
    td = strcompose("rs = ",x,"; tr = lineout('",xfret,"', rs, 1); tr = lineout('",xfret,"'); exit 0;");
    xhin = fileopen(xfins,"w");
    tr = filerecwrite(xhin,td);
    tcmd = strcompose("system NOBATCH NOSTOP ",rexxpath, " c:\\temp\\dret.ins");
    xhret = fileopen(xfret,"r");
    if(xhret == 0){return("REXXERROR");}
    tr = filerecread(xhret,xret);
  if(xopt == "exec"){
    tcmd = strcompose("system NOBATCH NOSTOP ",rexxpath,x);
Example 2:
Code shows how to call a REXX macro passing parms from command line: 

Command===> SPF dir2html

void spf(void) {
 char *trexx = "h:\\u\\pcdos\\rexx.exe  h:\\u\\spfpc40\\macros\\";
 char *tcmd;
 int   i;
 strcat(trexx,argv[1]);  //Get Name of REXX macro to execute passed from Edit command line
 strcat(trexx,".spf ");  //Could leave this off or change to REX/CMD etc.
 i = 2;
 while (i < argc) { strcat(trexx,StrCompose(" ",argv[i])); ++i; }//wend
 tcmd = strcompose("system NOBATCH NOSTOP ",trexx); //Build OS Command
 spfservice("cmd",tcmd);             //Send it to OS

Example 3:

Code to call REXX macro passing it the name of the edit file: 

Command===> ftpsend

//FTPSEND.SPF contains code to build FTP command sequence
void ftpsend(void){
 char *tcmd;
 char *tfilespec;
 tfilespec = spfservice("query","filespec");             //Get filespec being edited from SPF/SE
 tcmd = strcompose("system ","h:\\u\\pcdos\\rexx.exe h:\\u\\spfpc40\\macros\\ftpsend.spf ",tfilespec);
 spfservice("cmd",tcmd);     //Send to OS

SPF/SE though written for Windows will run in Linux using Wine.




HomePage | RecentChanges | EditorIndex | TextEditorFamilies | Preferences
Edit text of this page | View other revisions
Last edited March 23, 2017 10:00 pm (diff)