Ken Hirsch > MPE-CIvar > MPE::CIvar

Download:
MPE-CIvar-1.11.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.11   Source  

NAME ^

MPE::CIvar - Perl extension for CI variables and JCWs on MPE/ix

SYNOPSIS ^

  use MPE::CIvar ':all';


  $acct = hpcigetvar("HPACCOUNT");

  hpciputvar("TEMPVAR", 1);
  hpciputvar("TEMPVAR", hpcigetvar("TEMPVAR")+1);
  $hold = hpcigetvar("TEMPVAR");
  hpcideletevar("TEMPVAR");
  print "tempvar value was $hold\n";
  setjcw(32768);
  $jcw = getjcw();
  $ci = findjcw("CIERROR");
  putjcw("CIERROR", 0);

  hpcicommand("build TOOOLONGNAME.PUB,invaliddomain", undef, undef, 2);
  if ($CIVAR{HPCIERR}) {
    print "Error message: $CIVAR{HPCIERRMSG}\n";
  }

  hpcicmds("purge larry", 
           "build larry;rec=-80,,f,ascii",
           "file input=larry,old",
           "run darryl.pub")
    or die "Error on cmd: '$MPE::CIvar::lastcmd': $CIVAR{HPCIERRMSG}\n";

  $CIVAR{HPPATH} .= ",PERL.PUB";  # append PERL.PUB to HPPATH

DESCRIPTION ^

Access to the MPE/iX intrinsic functions:

     setjcw, getjcw
     putjcw, findjcw
     hpciputvar, hpcigetvar
     hpcideletevar
     hpcicommand

See the MPE/iX documentation at http://docs.hp.com/mpeix/all/ Specifically relevant for this module are:

   MPE/iX Intrinsics Reference Manual
   Command Interpreter Access and Variables Programmer's Guide
   Interprocess Communications Programmer's Guide

You may also access the CI variables through the tied hash, %CIVAR. This is analogous to %ENV but currently does not support 'each' or 'keys'.

setjcw(VALUE)

Sets the jcw JCW to the value VALUE (a 16-bit unsigned integer). Note that setting JCW to a value of 32768 or greater indicates that the program terminated in an error state and may cause a batch job to terminate.

getjcw()

Returns the value of the jcw JCW.

putjcw($name, VALUE)

Sets the jcw $name to the value VALUE (a 16-bit unsigned integer). The function putjcw will return 0 on success, an error code on failure.

findjcw($name)

Returns the value of the jcw $name.

hpcigetvar($name)

Returns the value of the CI variable $name. This function will return 'undef' if the variable does not exist. A boolean variable will be returned as 0 or 1.

hpciputvar($name, VALUE)

Sets the CI variable $name to VALUE. If VALUE is an integer it will be put as an integer value. If not, hpciputvar will try to interpret as a boolean or just put it as a string. The function hpciputvar will return 0 on success, an error code on failure.

hpcideletevar($name)

Deletes the CI variable $name. It will return 0 on success, an error code on failure.

%CIVAR

A hash tied to the CI variables. The follow are equivalent:

   $CIVAR{$name}         hpcigetvar($name)

   $CIVAR{$name}=VALUE   hpciputvar($name, value)

   delete $CIVAR{$name}  hpcideletevar($name)
hpcicommand($command [, $cmderr [, $parmnum [,$msglevel]]])

Calls intrinsic HPCICOMMAND with the command string. The other arguments are optional. A value of 0 will be returned on success, otherwise an error value will be returned and assigned to $cmderr if a variable is passed as the second argument. You can set $msglevel to 1 to suppress warnings and set it to 2 to suppress errors as well as warnings. For example,

   hpcicommand($command, undef, undef, 2);
hpcicmds( @cmdlist )

Calls hpcicommand for each string in @cmdlist. It will stop processing the list on an error, but not a warning. You can set the msglevel (see above) by assigning to $MPE::CIvar::msglevel before calling hpcicmds. You can see the last command executed by looking at $MPE::CIvar::lastcmd and any error in $MPE::CIvar::cmderr.

EXPORT ^

None by default.

AUTHOR ^

Ken Hirsch <kenhirsch@myself.com>

This module may be used and distributed on the same terms as Perl.

SEE ALSO ^

perl(1).

syntax highlighting: