HP3000-L Archives

May 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Eric Kundl <[log in to unmask]>
Reply To:
Eric Kundl <[log in to unmask]>
Date:
Wed, 7 May 1997 12:18:13 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (182 lines)
Ed,
At some point in the past, HP enhanced the JCW's so that when you set a
JCW, a variable is also set with the same name. I believe JCW's are limited
to numbers but a session variable can also hold strings and booleans. So
you can get a JCW or a Session Variable with the HPCIGETVAR intrinsic.

here is an example COBOL that I refer to:
hope it helps...

eric kundl - [log in to unmask]
HP Prog.Analyst


/t frcivar
  File numbered
  Record length: 80    bytes
  Number of records: 117
  File code: 1052
/l a
  1      identification division.
  1.1    program-id.    FRCIVAR.
  1.2    data division.
  1.3    working-storage section.
  1.4
  1.5        copy CIVARS.
  1.6
  1.7
  1.8    procedure division.
  1.9
  2      begin.
  2.1   ***     create some session variables
  2.2        perform CreateIntegerVariable
  2.3        perform CreateStringVariable
  2.4        perform CreateBooleanVariable
  2.5
  2.6   ***     read the session variables
  2.7        perform GetIntegerVariable
  2.8        display "integer var after cigetvar: ", 2-hpci-integer-value
  2.9
  3          perform GetStringVariable
  3.1        display " string var after cigetvar: ",
  3.2               2-hpci-string-value(1:2-hpci-integer-value)
  3.3
  3.4        perform GetBooleanVariable
  3.5        display "boolean var after cigetvar: " with no advancing
  3.6        if 2-hpci-integer-value = 2-hpci-boolean-true
  3.7            display 2-hpci-integer-value, " means true"
  3.8        else
  3.9            display 2-hpci-integer-value, " means false"
  4          end-if
  4.1    stop run.
  4.2
  4.3
  4.4    CreateIntegerVariable.
  4.5        move "TESTINTEGER;" to 2-session-variable-name
  4.6        compute 2-hpci-integer-value = 20
  4.7        call INTRINSIC "HPCIPUTVAR"
  4.8               using 2-session-variable-name
  4.9                     2-status-area
  5                       2-hpci-type-integer
  5.1                     2-hpci-integer-value
  5.2        end-call
  5.3        if 2-status-hi-word <> 0
  5.4            display "HPCIPUTVAR of integer failed"
  5.5        end-if.
  5.6
  5.7
  5.8    CreateStringVariable.
  5.9        move "TESTSTRING;" to 2-session-variable-name
  6          move "DUMMY STRING" to 2-hpci-string-value
  6.1        compute 2-hpci-integer-value = 12
  6.2        call INTRINSIC "HPCIPUTVAR"
  6.3               using 2-session-variable-name
  6.4                     2-status-area
  6.5                     2-hpci-type-string
  6.6                     2-hpci-string-value
  6.7                     2-hpci-type-string-length
  6.8                     2-hpci-integer-value
  6.9        end-call
  7          if 2-status-hi-word <> 0
  7.1            display "HPCIPUTVAR of string failed"
  7.2        end-if.
  7.3
  7.4
  7.5    CreateBooleanVariable.
  7.6        move "TESTBOOLEANTRUE;" to 2-session-variable-name
  7.7        call INTRINSIC "HPCIPUTVAR"
  7.8               using 2-session-variable-name
  7.9                     2-status-area
  8                       2-hpci-type-boolean
  8.1                     2-hpci-boolean-true
  8.2        end-call
  8.3        if 2-status-hi-word <> 0
  8.4            display "HPCIPUTVAR of boolean failed"
  8.5        end-if.
  8.6
  8.7
  8.8    GetIntegerVariable.
  8.9        move "TESTINTEGER;" to 2-session-variable-name
  9          call INTRINSIC "HPCIGETVAR"
  9.1               using 2-session-variable-name
  9.2                     2-status-area
  9.3                     2-hpci-type-integer
  9.4                     2-hpci-integer-value
  9.5        end-call
  9.6        if 2-status-hi-word <> 0
  9.7            display "HPCIGETVAR of integer failed"
  9.8        end-if.
  9.9
 10
 10.1    GetStringVariable.
 10.2        move "TESTSTRING;" to 2-session-variable-name
 10.3        call INTRINSIC "HPCIGETVAR"
 10.4               using 2-session-variable-name
 10.5                     2-status-area
 10.6                     2-hpci-type-string
 10.7                     2-hpci-string-value
 10.8                     2-hpci-type-string-length
 10.9                     2-hpci-integer-value
 11          end-call
 11.1        if 2-status-hi-word <> 0
 11.2            display "HPCIGETVAR of string failed"
 11.3        end-if.
 11.4
 11.5
 11.6    GetBooleanVariable.
 11.7        move "TESTBOOLEANTRUE;" to 2-session-variable-name
 11.8        call INTRINSIC "HPCIGETVAR"
 11.9               using 2-session-variable-name
 12                       2-status-area
 12.1                     2-hpci-type-boolean
 12.2                     2-hpci-integer-value
 12.3        end-call
 12.4        if 2-status-hi-word <> 0
 12.5            display "HPCIGETVAR of boolean failed"
 12.6        end-if.



Qedit/iX. Copyright Robelle Consulting Ltd. 1977-1996.  Type ? for help.
(Version 4.5.02)
Licensee:  NYLCare Health Plans, Inc. [97F]
    0.001
    1     *********************************************************
    1.1   **
    1.2   **     COPYLIB ENTRY: CIVARS                           **
    1.3   **            AUTHOR: ERIC KUNDL                       **
    1.4   **     Constants and Variables used when manipulating  **
    1.5   **     HP Command Session Variables                    **
    1.6   *********************************************************
    1.7    01  2-SESSION-VARIABLE-NAME    PIC X(255).
    1.8    01  2-STATUS-AREA.
    1.9        05  2-STATUS-HI-WORD       PIC S9(04) COMP.
    2          05  2-STATUS-LO-WORD       PIC S9(04) COMP.
    2.1    01  2-HPCI-TYPE-INTEGER        PIC S9(09) COMP VALUE +1.
    2.2    01  2-HPCI-TYPE-STRING         PIC S9(09) COMP VALUE +2.
    2.3    01  2-HPCI-TYPE-BOOLEAN        PIC S9(09) COMP VALUE +3.
    2.4    01  2-HPCI-TYPE-STRING-LENGTH  PIC S9(09) COMP VALUE +11.
    2.5    01  2-HPCI-BOOLEAN-TRUE        PIC S9(09) COMP VALUE +1.
    2.6    01  2-HPCI-BOOLEAN-FALSE       PIC S9(09) COMP VALUE 0.
    2.7    01  2-HPCI-STRING-VALUE        PIC X(80).
    2.8    01  2-HPCI-INTEGER-VALUE       PIC S9(09) COMP.
    2.9






--
eric kundl - [log in to unmask]
HP Prog.Analyst
 Ed Milner wrote in article <19970506203646745.AAA955@beech>...
>Does anyone know the cobol statement to get  a JCW value?
>I believe the intrinsic is 'GETJCW' and the format is 'jcw:=GETJCW'.
>I've called intrinsics with format " NAME(Parm1,Parm2)"  using
> "CALL INTRINSIC "intrinsic name" USING P1 P2"
>I cann't locate, or stumble upon,  the magic statement.
>
>Ed
>

ATOM RSS1 RSS2