Own line commands



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Own line commands

Postby LasseH » Fri May 02, 2014 1:54 pm

My "LINECMDS" program working just fine, BUT not for "block" commands

Every example I've found showing a test like this

if wordpos(lcmd,'CE RV LEF RIT') = 0 then


And the linecommand may be CEE-CEE or CE2, which ends up in "true"

My definition in 3.16 looks like this

                      ISPF EDIT Line Command Table  LINETBL  Row 11 to 13 of 13
 Command ===>                                                  Scroll ===> CSR 
                                                                Shift ===> PAGE
     User     MACRO    Program  Block    Multi    Dest                         
     Command           Macro    format   line     Used                         
     ----+--- ----+--- ----+--- ----+--- ----+--- ----+---                     
     CE       POSLINE  N        Y        Y        N                             
     RV       POSLINE  N        Y        Y        N                             


What I'm a doing wrong, anyone?
//Lasse
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Own line commands

Postby Pedro » Fri May 02, 2014 9:38 pm

Please elaborate on what you think is wrong.

I have not used the line command table. If you issue a block command that includes 10 lines, I think your program will get called 10 times, the same as if you issue your CE line command ten times. I am not sure if that is right or wrong, just my observation.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Own line commands

Postby enrico-sorichetti » Fri May 02, 2014 11:06 pm

If you issue a block command that includes 10 lines, I think your program will get called 10 times,

NOPE ;) the program will be invoke just once

IIRC the sequence to be used for a command supporting multiple lines ( BLOCK COMMAND )

should be along the lines of

/* obtain C-range */
"PROCESS RANGE C"

/* check if a C-range exists */
IF rc = 0 THEN DO
"(ZFRANGE) = LINENUM .ZFRANGE"
"(ZLRANGE) = LINENUM .ZLRANGE"
end
...

as explained here

http://publib.boulder.ibm.com/infocente ... Macros.pdf
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Own line commands

Postby Pedro » Fri May 02, 2014 11:35 pm

I have not used the line command table.


I should learn to stay quiet for things I do not know. :-)
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Own line commands

Postby LasseH » Mon May 05, 2014 11:53 am

Pedro, that's what I thought to, but no...
Enrico, then the example on page 8 in the document won't work either
//Lasse
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Own line commands

Postby enrico-sorichetti » Mon May 05, 2014 2:04 pm

tested using the old LMAC
but according to the manuals it should not make any difference

( note how the PROCESS RANGE construct takes care automagically
of a single line selection )

the macro
 EDIT       ENRICO.ISPF.EXEC(LINEMAC) - 01.05               Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 ****** ***************************** Top of Data ******************************
 000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 000002 /*                                                                   */
 000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 000004 Trace "O"
 000005
 000006 Parse Source _sys _how _cmd .
 000007
 000008 _ack = 0
 000009 _ack = 1
 000010
 000011 If ( Sysvar(SYSISPF) \= "ACTIVE" ) Then Do
 000012    Say left(_cmd,8)"- Ispf is not active. Command not executed"
 000013    exit 4
 000014 End
 000015
 000016 call $ispex "CONTROL ERRORS RETURN "
 000017
 000018 if ( $isred("MACRO (LCMD) NOPROCESS ") \= 0 ) then do
 000019    zedsmsg = "Invocation ERROR"
 000020    zedlmsg = left(_cmd,8)"- Must be invoked as a MACRO"
 000021    call $ispex "SETMSG MSG(ISRZ001)"
 000022    exit 4
 000023 end
 000024
 000025 if ( $isred("PROCESS RANGE " lcmd ) \= 0 ) then do
 000026    call $ispex "SETMSG MSG(ISRZ002) "
 000027    exit 8
 000028 end
 000029
 000030 call $isred "(XFRANGE)  = LINENUM .ZFRANGE "
 000031 call $isred "(XLRANGE)  = LINENUM .ZLRANGE "
 000032
 000033 xvars = rxvars()
 000034 do i = 1 to words(xvars)
 000035    v = word(xvars, i)
 000036    say left(v,12) value(v)
 000037 end
 000038
 000039 If  ( _ack = 1 ) then do
 000040     zedsmsg = left(_cmd,8)"- Ended"
 000041     zedlmsg = left(_cmd,8)"- Ended"
 000042     call $ispex "SETMSG MSG(ISRZ001) "
 000043 end
 000044
 000045 Exit 0
 000046
 000047 /* */
 000048 $tsoex:
 000049    tso_0tr = trace("O")
 000050    Address TSO arg(1)
 000051    tso_0rc = rc
 000052    trace value(tso_0tr)
 000053    return tso_0rc
 000054
 000055 /* */
 000056 $ispex:
 000057    isp_tr = trace("O")
 000058    Address ISPEXEC arg(1)
 000059    isp_rc = rc
 000060    trace value(isp_tr)
 000061    return isp_rc
 000062
 000063 /* */
 000064 $isred:
 000065    isr_tr = trace("O")
 000066    Address ISREDIT arg(1)
 000067    isr_rc = rc
 000068    trace value(isr_tr)
 000069    return isr_rc
 000070
 ****** **************************** Bottom of Data ****************************
 


the BLOCK command
the command is Z, doubled to ZZ to make it a block command
 000060    trace value(isp_tr)
 000061    return isp_rc
 000062
 000063 /* */
 ZZ0064 $isred:
 000065    isr_tr = trace("O")
 000066    Address ISREDIT arg(1)
 000067    isr_rc = rc
 000068    trace value(isr_tr)
 00ZZ69    return isr_rc
 000070
 ****** **************************** Bottom of Data ****************************
 



the content of the variables
 _ACK         1
 _CMD         LINEMAC
 _HOW         COMMAND
 _SYS         TSO
 ISP_RC       0
 ISP_TR       O
 ISR_RC       0
 ISR_TR       O
 LCMD         Z
 RC           0
 RESULT       0
 SIGL         31
 XFRANGE      00000064
 XLRANGE      00000069
 ***


the SINGLE line command
the command is a single Y
 000060    trace value(isp_tr)
 000061    return isp_rc
 000062
 000063 /* */
 000064 $isred:
 000065    isr_tr = trace("O")
 0y0066    Address ISREDIT arg(1)
 000067    isr_rc = rc
 000068    trace value(isr_tr)
 000069    return isr_rc
 000070
 ****** **************************** Bottom of Data ****************************
 


the content of the variables
 _ACK         1
 _CMD         LINEMAC
 _HOW         COMMAND
 _SYS         TSO
 ISP_RC       0
 ISP_TR       O
 ISR_RC       0
 ISR_TR       O
 LCMD         Y
 RC           0
 RESULT       0
 SIGL         31
 XFRANGE      00000066
 XLRANGE      00000066
 ***
 


here is the BLOCK command ( with a repetition count )
the command is a W3
 000060    trace value(isp_tr)
 000061    return isp_rc
 000062
 000063 /* */
 000064 $isred:
 000065    isr_tr = trace("O")
 000066    Address ISREDIT arg(1)
 w30067    isr_rc = rc
 000068    trace value(isr_tr)
 000069    return isr_rc
 000070
 ****** **************************** Bottom of Data ****************************


the content of the variables
 _ACK         1
 _CMD         LINEMAC
 _HOW         COMMAND
 _SYS         TSO
 ISP_RC       0
 ISP_TR       O
 ISR_RC       0
 ISR_TR       O
 LCMD         W
 RC           0
 RESULT       0
 SIGL         31
 XFRANGE      00000067
 XLRANGE      00000069
 ***




-- edited to add the repletion count test
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Own line commands

Postby LasseH » Mon May 05, 2014 5:42 pm

Enrico, I'm getting the same results when using LMAC, it works.
So it doesn't seems to be transparent (work the same)
//Lasse
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time

Re: Own line commands

Postby enrico-sorichetti » Mon May 05, 2014 5:53 pm

probably time to open a PMR with IBM
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Own line commands

Postby LasseH » Mon Jun 09, 2014 11:58 am

PMR 67826,130,846 opened
//Lasse
LasseH
 
Posts: 70
Joined: Mon Nov 08, 2010 2:51 pm
Has thanked: 7 times
Been thanked: 1 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post