home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / iwzmsav.lx < prev    next >
Text File  |  1997-12-17  |  20KB  |  709 lines

  1. /* Reinvoking as "REXX %0 %1 %2 %3 %4 %5 %6 %7 %8 %9"  2>nul
  2. @goto runit */
  3. /*********************************************************************/
  4. /* Licensed Material - Property of IBM                               */
  5. /* 5639-B92 , 5639-D65 (C) Copyright IBM Corp., 1997, 1998           */
  6. /* All rights reserved.                                              */
  7. /* US Government Users Restricted Rights - Use, duplication or       */
  8. /* disclosure restricted by GSA ADP Schedule Contract with IBM Corp. */
  9. /*********************************************************************/
  10. trace off;
  11. signal on novalue;
  12. parse source opsys . whoami rest;
  13. /* cobolroot is now set by iwzmIR.CMD */
  14. if opsys = 'OS/2' then
  15.   do;
  16.   env = 'OS2ENVIRONMENT';
  17.   callit = '@Call';
  18.   call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs';
  19.   call SysLoadFuncs;
  20.   end;
  21. else
  22.   do;
  23.   env = 'ENVIRONMENT';
  24.   callit = '@Rexx';
  25.   end;
  26. tempdir = value('TMP',,env);
  27. tempout = SysTempFileName(tempdir'\TM?????.OUT');
  28. tempout2 = SysTempFileName(tempdir'\T2?????.OUT');
  29. xx = Get_MVSINFO();
  30. if xx <> 0 then
  31.   exit 16;
  32. call Set_MVSINFO_Vars;
  33. if tracemod = '*' |,
  34.   wordpos(translate(substr(whoami,lastpos('\',whoami)+1)),tracemod) > 0 then
  35.   do;
  36.   if trace > 3 then trace results;
  37.   if trace > 4 then trace ?;
  38.   end;
  39. parse arg the_input_args;
  40. call traceit 1 'Entry' '!'the_input_args'!';
  41. trysave = 'no';
  42. trytemp = 'no';
  43. didprot = 'no';
  44. protsavetype = '';
  45. tmpsave = random(99999);
  46. tmpsave = substr('00000'tmpsave,length(tmpsave),6);
  47. tmpsave = value('TMP',,env)'\CS'tmpsave'.MVS';
  48. 'set messages on';
  49. 'check';
  50. 'extract changes into changes';
  51. 'extract name into filename';
  52. call traceit 2 'Save for' filename;
  53. if filesys = 'SDU' then
  54.   timeout = 'SDU';
  55. else
  56.   do;
  57.   if writetimeout = '' | writetimeout < 1 then
  58.     timeout = 1;
  59.   else
  60.     timeout = writetimeout;
  61.   end;
  62. parse arg theargs;
  63. newargs = '';
  64. inquote = 'no';
  65. sepchar = '01'x;
  66. if length(theargs) > 0 then
  67.   do;
  68.   do ii = 1 to length(theargs);
  69.     thechar = substr(theargs,ii,1);
  70.     select;
  71.       when thechar = '"' then
  72.         do;
  73.         if inquote = 'yes' then
  74.           inquote = 'no';
  75.         else
  76.           inquote = 'yes';
  77.         newargs = newargs||thechar;
  78.         end;
  79.       when thechar == ' ' then
  80.         do;
  81.         if inquote = 'yes' then
  82.           newargs = newargs||sepchar;
  83.         else
  84.           newargs = newargs||thechar;
  85.         end;
  86.       otherwise
  87.         newargs = newargs||thechar;
  88.       end;
  89.     end;
  90.   end;
  91. do ii = 1 to 12;
  92.   thearg.ii = word(newargs,ii);
  93.   thearg.ii = translate(thearg.ii,' ',sepchar);
  94.   end;
  95. a1 = thearg.1;
  96. savetype = 'save';
  97. if a1 <> '' then
  98.   do;
  99.   if substr(a1,1,1) <> '/' then
  100.     do;
  101.     savetype = 'saveas';
  102.     savename = a1;
  103.     end;
  104.   else
  105.     savename = filename;
  106.   end;
  107. else
  108.   savename = filename;
  109. if savetype = 'save' & protsave <> 'NO' then
  110.   do;
  111.   'extract docnum into docnum';
  112.   'extract global.protsave_'docnum 'into savestat';
  113.   'extract global.protsave_saveall into saveallstat';
  114.   if savestat = 'protsave' then
  115.     do;
  116.     call message 01;
  117.     'alarm';
  118.     call traceit 1 'Error exit';
  119.     exit -6;
  120.     end;
  121.   if length(filename) < 3 then
  122.     call errmsg 02 filename;
  123.   if substr(filename,2,2) <> ':\' then
  124.     call errmsg 02 filename;
  125.   usedrive = substr(filename,1,2);
  126.   usedrive = translate(usedrive);
  127.   parse upper var filename filedrive '\' dsname '\' member;
  128.   if dsname = '' then
  129.     call errmsg 02 filename;
  130.   if member <> '' then
  131.     do;
  132.     parse var member member '.' memext;
  133.     if memext <> '' then
  134.       memext = '.'memext;
  135.     if member = '' then
  136.       call errmsg 02 filename;
  137.     hqual = '';
  138.     if numdrive > 0 then
  139.       do;
  140.       do ii = 1 to numdrive;
  141.         if usedrive = drive.ii then
  142.           do;
  143.           hqual = highqual.ii;
  144.           leave;
  145.           end;
  146.         end;
  147.       end;
  148.     if hqual = '' then
  149.       call errmsg 03 filename;
  150.     dsname = hqual'.'dsname;
  151.     'extract docnum into docnum';
  152.     'extract global.tempdsn_'docnum 'into tempsaved';
  153.     'extract global.mvsrecfm_'docnum 'into mvsrecfm';
  154.     'extract global.mvslrecl_'docnum 'into mvslrecl';
  155.     extract_rc = rc;
  156.     if extract_rc <> 0 then
  157.       call errmsg 04;
  158.     parse var tempsaved tempsaved '/' maxrecd;
  159.     tempsaved2 = tempsaved;
  160.     if maxrecd = '' then
  161.       maxrecd = 99999998;
  162.     tempsaved = strip(tempsaved,'B',"'");
  163.     tmpdrv = '';
  164.     if tempdata <> '' then
  165.       do;
  166.       if numdrive > 0 then
  167.         do;
  168.         do ii = 1 to numdrive;
  169.           if tempdata = drive.ii & trans.ii = 'text,crlf' then
  170.             do;
  171.             tmpdrv = drive.ii;
  172.             temphqual = highqual.ii;
  173.             len = length(temphqual) + 2;
  174.             temprest = substr(tempsaved,len);
  175.             leave;
  176.             end;
  177.           end;
  178.         end;
  179.       end;
  180.     else
  181.       do;
  182.       parse upper var tempsaved temphqual '.' temprest;
  183.       if numdrive > 0 then
  184.         do;
  185.         do ii = 1 to numdrive;
  186.           if temphqual = highqual.ii & trans.ii = 'text,crlf' then
  187.             do;
  188.             tmpdrv = drive.ii;
  189.             leave;
  190.             end;
  191.           end;
  192.         end;
  193.       end;
  194.     if tmpdrv = '' then
  195.       call errmsg 05;
  196.     'extract elements into numlines';
  197.     if numlines > 99999998 then
  198.       call errmsg 06;
  199.     maxstor = (numlines + 1) * mvslrecl;
  200.     if maxstor > ((2 ** 31) - 1) then
  201.       call errmsg 07;
  202.     if numlines >= maxrecd then /* allow for one more for timestamp */
  203.       do;
  204.       call message 08;
  205.       'sshow';
  206.       xx = SysSleep(1);
  207.       iwzmtso = '+IGYFINFO' tempsaved2 'TDR' tempmult numlines;
  208.       call traceit 2 'Before IGYFINFO';
  209.       if mvscomm = 'YES' then
  210.         do;
  211.         iwzmtso = substr(iwzmtso,2);
  212.         call iwzmvws.cmd iwzmtso '>'tempout;
  213.         end;
  214.       else
  215.         address cmd callit 'iwzmscm.cmd' callit 'iwzmtso.cmd !!??'tempout'??'iwzmtso;
  216.       call traceit 2 'After IGYFINFO';
  217.       read_stem.0 = 0;
  218.       xx = linein(tempout,1,0);
  219.       do forever;
  220.         if lines(tempout) = 0 then
  221.           leave;
  222.         read_stem.0 = read_stem.0 + 1;
  223.         nn = read_stem.0;
  224.         read_stem.nn = linein(tempout);
  225.         if substr(read_stem.nn,1,2) = '??' then
  226.           read_stem.nn = substr(read_stem.nn,3);
  227.         end;
  228.       xx = stream(tempout,'C','CLOSE');
  229.       address cmd '@erase' tempout;
  230.       if read_stem.0 = 0 then
  231.         call errmsg 09;
  232.       parse upper var read_stem.1 rcode recfm lrecl dsorg seqnum alias badhex memexist tempdsn rest;
  233.       if rcode <> 'OK' then
  234.         do;
  235.         if rcode = '' then
  236.           rcode = '??';
  237.         call lpexmsg rcode rest;
  238.         if read_stem.0 > 1 then
  239.           do;
  240.           do ii = 2 to read_stem.0;
  241.             if read_stem.ii <> '' then
  242.               call lpexmsg read_stem.ii;
  243.             end;
  244.           end;
  245.         call errmsg 10;
  246.         end;
  247.       'extract docnum into docnum';
  248.       'set global.tempdsn_'docnum tempdsn;
  249.       end;
  250.     tempsave = tmpdrv'\'temprest;
  251.     didprot = 'yes';
  252.     end;
  253.   end;
  254. if didprot = 'yes' then
  255.   do;
  256.   thedate = date('U');
  257.   thetime = time();
  258.   timestamp = substr(thedate,1,2)||substr(thedate,4,2)||substr(thedate,7,2);
  259.   timestamp = timestamp||substr(thetime,1,2)||substr(thetime,4,2)||substr(thetime,7,2);
  260.   'mark set @@iwzmsav@@';
  261.   'bottom';
  262.   addedtime = 'no';
  263.   if (substr(mvsrecfm,1,1) = 'F' & mvslrecl >= 12) |,
  264.     (substr(mvsrecfm,1,1) = 'V' & mvslrecl >= 16) then
  265.     do;
  266.     addedtime = 'yes';
  267.     'extract autoparse into autoparse';
  268.     'extract recording into recording';
  269.     'set autoparse off';
  270.     'set recording off';
  271.     'insert' timestamp;
  272.     end;
  273.   'bottom';
  274.   'extract linenumber into numrec';
  275.   'mark set @@iwzmsavb@@';
  276.   call traceit 2 'Before save to temp' tempsave;
  277.   'lxn save' tempsave;
  278.   save_rc = rc;
  279.   call traceit 2 'Save to temp return code' save_rc;
  280.   call traceit 2 'After save to temp' tempsave;
  281.   'set name' filename;
  282.   if addedtime = 'yes' then
  283.     do;
  284.     'mark find @@iwzmsavb@@';
  285.     'mark clear @@iwzmsavb@@';
  286.     'extract linenumber into numrec2';
  287.     if numrec2 <> numrec then
  288.       call errmsg 11;
  289.     'extract content into content';
  290.     if content <> timestamp then
  291.       call errmsg 12;
  292.     'delete';
  293.     'set recording' recording;
  294.     'set autoparse' autoparse;
  295.     end;
  296.   'mark find @@iwzmsav@@';
  297.   'mark clear @@iwzmsav@@';
  298.   end;
  299. else
  300.   do;
  301.   'lxn save' theargs;
  302.   save_rc = rc;
  303.   end;
  304. trysave = 'yes';
  305. if didprot = 'yes' then
  306.   do;
  307.   if save_rc = 0 then
  308.     do;
  309.     'extract docnum into docnum';
  310.     'set global.protsave_'docnum 'protsave';
  311.     if mvsrecfm = 'F' | mvsrecfm = 'V' then
  312.       userecfm = mvsrecfm||'B';
  313.     else
  314.       userecfm = mvsrecfm;
  315.     iwzmtso = '+IGYFMSAV' tempsaved dsname member userecfm mvslrecl numrec timestamp language;
  316.     call traceit 2 'Before iwzmSAV.CMD';
  317.     if savestat <> 'quitsave' & saveallstat <> 'saveall' then
  318.       do;
  319.       protsavetype = 'asynch';
  320.       if opsys = 'OS/2' then
  321.         address cmd '@start /c /min /i iwzmsav.cmd' protsavetype timeout tempsave filename member docnum changes iwzmtso;
  322.       else
  323.         address cmd '@start /min /i rexx iwzmsav.cmd' protsavetype timeout tempsave filename member docnum changes iwzmtso;
  324.       end;
  325.     else
  326.       do;
  327.       protsavetype = 'synch';
  328.       address cmd callit 'iwzmscm.cmd' callit 'iwzmsav.cmd' protsavetype timeout tempsave filename member docnum changes iwzmtso;
  329.       iwzmsav_rc = rc;
  330.       if iwzmsav_rc <> 0 then
  331.         save_rc = -6;
  332.       'set global.protsave_'docnum 'null';
  333.       end;
  334.     call traceit 2 'After iwzmSAV.CMD';
  335.     end;
  336.   end;
  337. else
  338.   address cmd callit 'iwzmscm.cmd' callit 'iwzmcls.cmd save' savename 'check';
  339. if save_rc = -6 then
  340.   do;
  341.   call tempsave;
  342.   call errmsg;
  343.   end;
  344. if save_rc >= 0 & didprot = 'yes' & protsavetype = 'asynch' then
  345.   call message 13;
  346. if save_rc = 0 then
  347.   call traceit 1 'Normal exit';
  348. else
  349.   call traceit 1 'Error exit';
  350. exit save_rc;
  351. /* */
  352. errmsg:
  353. parse arg the_msg;
  354. call tempsave;
  355. if the_msg <> '' then
  356.   do;
  357.   call lpexmsg;
  358.   call message the_msg;
  359.   end;
  360. call lpexmsg;
  361. call message 14;
  362. 'alarm';
  363. 'alarm';
  364. call traceit 1 'Error exit';
  365. exit -6;
  366. /* */
  367. tempsave:
  368. if trytemp = 'yes' then
  369.   return;
  370. trytemp = 'yes';
  371. call message 15;
  372. call traceit 2 'Before save to workstation';
  373. 'lxn save' tmpsave;
  374. savet_rc = rc;
  375. call traceit 2 'After save to workstation';
  376. 'set name' filename;
  377. if savet_rc <> 0 then
  378.   call message 16;
  379. else
  380.   call message 17 tmpsave;
  381. 'set changes' changes;
  382. return;
  383. /* */
  384. lpexmsg:
  385. parse arg lpex_msg;
  386. if trace > 2 then
  387.   call traceit 3 '--->' lpex_msg;
  388. 'msg' lpex_msg;
  389. return;
  390. /* */
  391. message:
  392. parse arg iwz_message_num,
  393.           iwz_message_arg1 '\\',
  394.           iwz_message_arg2 '\\',
  395.           iwz_message_arg3 '\\',
  396.           iwz_message_arg4 '\\',
  397.           iwz_message_arg5 '\\',
  398.           iwz_message_arg6 '\\',
  399.           iwz_message_arg7 '\\',
  400.           iwz_message_arg8;
  401. select;
  402.   when language = 'ENG' then
  403.     call message_eng;
  404.   when language = 'JPN' then
  405.     call message_jpn;
  406.   otherwise
  407.     call message_eng;
  408.   end;
  409. return;
  410. /* */
  411. message_eng:
  412. select;
  413.  
  414. when iwz_message_num = 1 then do;
  415. call lpexmsg 'A protected save is still running';
  416. end;
  417.  
  418. when iwz_message_num = 2 then do;
  419. call lpexmsg 'Cannot understand filename' iwz_message_arg1;
  420. end;
  421.  
  422. when iwz_message_num = 3 then do;
  423. call lpexmsg 'Cannot determine high level qualifier for' iwz_message_arg1;
  424. end;
  425.  
  426. when iwz_message_num = 4 then do;
  427. call lpexmsg 'Cannot determine name of temporary save data set';
  428. end;
  429.  
  430. when iwz_message_num = 5 then do;
  431. call lpexmsg 'No drive defined for temporary save data set';
  432. end;
  433.  
  434. when iwz_message_num = 6 then do;
  435. call lpexmsg 'Cannot support more that 99999998 records';
  436. end;
  437.  
  438. when iwz_message_num = 7 then do;
  439. call lpexmsg 'Cannot save - requires at least 2 gigabytes on MVS';
  440. end;
  441.  
  442. when iwz_message_num = 8 then do;
  443. call lpexmsg 'Allocating a larger temporary data set';
  444. end;
  445.  
  446. when iwz_message_num = 9 then do;
  447. call lpexmsg 'iwzmSAV.LX internal error - IGYFINFO return nothing';
  448. end;
  449.  
  450. when iwz_message_num = 10 then do;
  451. call lpexmsg 'Error allocating temporary data set';
  452. end;
  453.  
  454. when iwz_message_num = 11 then do;
  455. call lpexmsg 'ERROR - cannot locate added temporay line';
  456. end;
  457.  
  458. when iwz_message_num = 12 then do;
  459. call lpexmsg 'ERROR - unknown added temporary line contents';
  460. end;
  461.  
  462. when iwz_message_num = 13 then do;
  463. call lpexmsg 'Running final protected save processing asynchronously';
  464. end;
  465.  
  466. when iwz_message_num = 14 then do;
  467. call lpexmsg 'Save failed, select "Windows->Macro log" to see failure messages';
  468. end;
  469.  
  470. when iwz_message_num = 15 then do;
  471. call lpexmsg 'The save request failed, will attempt to save to the workstation';
  472. end;
  473.  
  474. when iwz_message_num = 16 then do;
  475. call lpexmsg 'Was not able to save to workstation';
  476. end;
  477.  
  478. when iwz_message_num = 17 then do;
  479. call lpexmsg 'File was saved to workstation file' iwz_message_arg1;
  480. end;
  481.  
  482. otherwise
  483. call lpexmsg 'Invalid message number' iwz_message_num;
  484. end;
  485. return;
  486. /* */
  487. message_jpn:
  488. call lpexmsg 'Japanese message';
  489. select;
  490.  
  491. when iwz_message_num = 1 then do;
  492. call lpexmsg 'A protected save is still running';
  493. end;
  494.  
  495. when iwz_message_num = 2 then do;
  496. call lpexmsg 'Cannot understand filename' iwz_message_arg1;
  497. end;
  498.  
  499. when iwz_message_num = 3 then do;
  500. call lpexmsg 'Cannot determine high level qualifier for' iwz_message_arg1;
  501. end;
  502.  
  503. when iwz_message_num = 4 then do;
  504. call lpexmsg 'Cannot determine name of temporary save data set';
  505. end;
  506.  
  507. when iwz_message_num = 5 then do;
  508. call lpexmsg 'No drive defined for temporary save data set';
  509. end;
  510.  
  511. when iwz_message_num = 6 then do;
  512. call lpexmsg 'Cannot support more that 99999998 records';
  513. end;
  514.  
  515. when iwz_message_num = 7 then do;
  516. call lpexmsg 'Cannot save - requires at least 2 gigabytes on MVS';
  517. end;
  518.  
  519. when iwz_message_num = 8 then do;
  520. call lpexmsg 'Allocating a larger temporary data set';
  521. end;
  522.  
  523. when iwz_message_num = 9 then do;
  524. call lpexmsg 'iwzmSAV.LX internal error - IGYFINFO return nothing';
  525. end;
  526.  
  527. when iwz_message_num = 10 then do;
  528. call lpexmsg 'Error allocating temporary data set';
  529. end;
  530.  
  531. when iwz_message_num = 11 then do;
  532. call lpexmsg 'ERROR - cannot locate added temporay line';
  533. end;
  534.  
  535. when iwz_message_num = 12 then do;
  536. call lpexmsg 'ERROR - unknown added temporary line contents';
  537. end;
  538.  
  539. when iwz_message_num = 13 then do;
  540. call lpexmsg 'Running final protected save processing asynchronously';
  541. end;
  542.  
  543. when iwz_message_num = 14 then do;
  544. call lpexmsg 'Save failed, select "Windows->Macro log" to see failure messages';
  545. end;
  546.  
  547. when iwz_message_num = 15 then do;
  548. call lpexmsg 'The save request failed, will attempt to save to the workstation';
  549. end;
  550.  
  551. when iwz_message_num = 16 then do;
  552. call lpexmsg 'Was not able to save to workstation';
  553. end;
  554.  
  555. when iwz_message_num = 17 then do;
  556. call lpexmsg 'File was saved to workstation file' iwz_message_arg1;
  557. end;
  558.  
  559. otherwise
  560. call lpexmsg 'Invalid message number' iwz_message_num;
  561. end;
  562. return;
  563. Get_MVSINFO:
  564. Procedure expose env cobolroot mvsinfo. whoami tempdir trace
  565.  
  566. rtn = 0
  567. null = '0000'x
  568. crlf = '0D0A'x
  569. mvsinfo. = ''
  570. mvsinfoQ = translate('iwzm_MVSINFO.DAT_YALE');
  571.  
  572. oldq = rxqueue('Set',mvsinfoQ)   /* switch to mvsinfo queue */
  573. if queued() = 0 then do                   /* if Q is missing we'll */
  574.   qname = rxqueue('Create',mvsinfoQ)      /* create it and put a bad */
  575.   if qname = mvsinfoQ then push 'Sven'    /* timestamp on it, else */
  576.   else x=rxqueue('Delete',qname)          /* it was in use (we hope) */
  577.   end                                     /* so we'll assume we can */
  578. parse pull mvsstuff; push mvsstuff        /* get/replace Q contents */
  579. parse value mvsstuff with ts (null) . cobolroot (null) mvsstuff /* get */
  580.                                         /* timestamp and cobolroot */
  581. if ts <> 'Sven' then do;
  582.   mvsinfo = cobolroot'\MACROS\MVSINFO.DAT'
  583.   bad_mvsinfo = '    **' whoami '****'crlf'    **error*' mvsinfo,
  584.                 'is unavailable, missing or empty **'
  585.  
  586.   x=SysFileTree(mvsinfo,'ts','F')       /* get MVSINFO.DAT's timestamp */
  587.   if ts.0 <> 1 then do
  588.     say bad_mvsinfo
  589.     return 12;
  590.     end
  591.   parse var ts.1 v0 v1 v2 .
  592.   timestamp ='mvsinfo.dat.timestamp' v0 v1 v2
  593.   end;
  594. else
  595.   timestamp = 'Yale'
  596. if timestamp <> ts then do              /* timestamps match? */
  597.   pull mvsstuff                         /* no, remove bad contents */
  598.   rtn = "iwzmIR.CMD"()                /* ask for new stuff */
  599.   if rtn = 0 then do
  600.     parse pull mvsstuff; push mvsstuff    /* get/replace Q contents */
  601.                                         /* remove timestamp and     */
  602.                                         /* cobolroot                */
  603.     parse value mvsstuff with . (null) . cobolroot ( null) mvsstuff
  604.     end
  605.   end
  606. qname = rxqueue('Set',oldq)      /* restore normal queue */
  607.  
  608. do while (mvsstuff<>'') & (rtn=0)   /* mvsinfo. structure */
  609.   parse value mvsstuff with key val (null) mvsstuff
  610.   if mvsinfo.key = '' then do       /* e.g. mvsinfo.TYPE='' */
  611.     mvsinfo.KEYS = mvsinfo.KEYS key /* no substitution for KEYS */
  612.     mvsinfo.key.1 = val             /* e.g. mvsinfo.TYPE.1=val  */
  613.     mvsinfo.key = 1                 /* e.g. mvsinfo.TYPE=1      */
  614.     end
  615.   else do
  616.     x = mvsinfo.key + 1             /* e.g. mvsinfo.TYPE+1     */
  617.     mvsinfo.key.x = val             /* e.g. mvsinfo.TYPE.2=val */
  618.     mvsinfo.key = x                 /* e.g. mvsinfo.TYPE=2     */
  619.     end
  620.   end
  621.  
  622. return rtn
  623.  
  624. Set_MVSINFO_Vars:
  625.  
  626.  parse var mvsinfo.CLOSECMD.1 closecmd;
  627.  parse var mvsinfo.CLOSEFILE.1 closefile;
  628.  parse var mvsinfo.FILESYS.1 filesys accessmon testaccess;
  629.  parse var mvsinfo.FSSTARTCMD.1 fsstartcmd;
  630.  parse var mvsinfo.FSSTOPCMD.1 fsstopcmd;
  631.  parse var mvsinfo.HEADER.1 header;
  632.  parse var mvsinfo.JOBLOG.1 joblog;
  633.  parse var mvsinfo.MAXCMD.1 maxcmd;
  634.  parse var mvsinfo.LANGUAGE.1 language;
  635.  parse var mvsinfo.MOUNTCMD.1 mountcmd;
  636.  parse var mvsinfo.MVSCOMM.1 mvscomm;
  637.  parse var mvsinfo.iwzmEDT.1 iwzmedt;
  638.  parse var mvsinfo.NFS.1 nfs;
  639.  parse var mvsinfo.NULLSTDIN.1 nullstdin;
  640.  parse var mvsinfo.OUTSHOW.1 outshow;
  641.  parse var mvsinfo.PROTSAVE.1 protsave tempmult;
  642.  parse var mvsinfo.PWD.1 pwd pwdasis pwdt pwde;
  643.  parse var mvsinfo.READTIMEOUT.1 readtimeout;
  644.  parse var mvsinfo.REXECCMD.1 rexeccmd;
  645.  parse var mvsinfo.SDU.1 sdu;
  646.  parse var mvsinfo.SIGYCLST.1 sigyclst;
  647.  parse var mvsinfo.SYSPROC.1 sysproc;
  648.  parse var mvsinfo.SYSTEM.1 system;
  649.  parse var mvsinfo.TEMPDRIVE.1 tempdrive;
  650.  parse var mvsinfo.TEMPDATA.1 tempdata;
  651.  parse var mvsinfo.TESTFILE.1 testfile;
  652.  parse var mvsinfo.TRACE.1 trace tracekeep;
  653.  parse var mvsinfo.TRACECMD.1 tracecmd;
  654.  parse var mvsinfo.TRACEMOD.1 tracemod;
  655.  parse var mvsinfo.UMOUNTCMD.1 umountcmd;
  656.  parse var mvsinfo.USERID.1 userid;
  657.  parse var mvsinfo.WORKSYS.1 worksys;
  658.  parse var mvsinfo.WRITETIMEOUT.1 writetimeout;
  659.  
  660.  parse var mvsinfo.DRIVE numdrive;
  661.  if numdrive = '' then
  662.    numdrive = 0;
  663.  do ii = 1 to numdrive;
  664.    parse var mvsinfo.DRIVE.ii,
  665.              drive.ii highqual.ii trans.ii mapping.ii sidefile.ii;
  666.    end;
  667.  
  668.  parse var mvsinfo.TYPE numtype;
  669.  if numtype = '' then
  670.    numtype = 0;
  671.  do ii = 1 to numtype;
  672.    parse var mvsinfo.TYPE.ii type.ii ext.ii;
  673.    end;
  674.  
  675. return
  676.  
  677. /* */
  678. Traceit:
  679.  parse arg iwz_trc_level iwz_trc_message;
  680.  if iwz_trc_level > trace then
  681.    return;
  682.  if pwd <> '********' & pwd <> '++++++++' & pwd <> '========' then
  683.    do;
  684.    do forever;
  685.      if pos(pwd,iwz_trc_message) = 0 then
  686.        leave;
  687.      parse var iwz_trc_message iwz_trc_message1 (pwd) iwz_trc_message2;
  688.      iwz_trc_message = iwz_trc_message1||'********'||iwz_trc_message2
  689.      end;
  690.    end
  691.  iwz_trc_message = date('O') time('L') whoami':' iwz_trc_message;
  692.  xx = lineout(tempdir'\iwzmTRC.TRC',iwz_trc_message);
  693.  xx = stream(tempdir'\iwzmTRC.TRC','C','CLOSE');
  694.  if tracecmd <> '' then
  695.    interpret tracecmd;
  696. return;
  697.  
  698. /* */
  699. sayit:
  700.  parse arg iwz_sayit_arg;
  701.  if trace > 2 then
  702.    call traceit 3 '--->' iwz_sayit_arg;
  703.  say iwz_sayit_arg;
  704. return;
  705. /*
  706. :runit
  707. @rexx %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
  708. @rem */
  709.