For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2004 > INSPECT: OS/VS vs. IBM Enterprise COBOL for z/OS and OS/390 3.2.0









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author INSPECT: OS/VS vs. IBM Enterprise COBOL for z/OS and OS/390 3.2.0
docdwarf@panix.com

2004-05-17, 11:30 am


All righty... as mentioned the other day I coded:

01 CHAR-1 PIC X.
01 CHAR-80 PIC X(80).

....
PROCEDURE DIVISION.

PERFORM INSPECT-1.
PERFORM INSPECT-80.
GOBACK.
INSPECT-1.
INSPECT CHAR-1 REPLACING ALL 'a' BY 'A'.
INSPECT-80.
INSPECT CHAR-80 REPLACING ALL 'a' BY 'A'
ALL 'b' BY 'B'
ALL 'c' BY 'C'
ALL 'd' BY 'D'
ALL 'e' BY 'E'
ALL 'f' BY 'F'
ALL 'g' BY 'G'
ALL 'h' BY 'H'
ALL 'i' BY 'I'
ALL 'j' BY 'J'
ALL 'k' BY 'K'
ALL 'l' BY 'L'
ALL 'm' BY 'M'
ALL 'n' BY 'N'.

.... and compiled. For the first INSPECT OS/VS COBOL gave:

LA 0,001(0,0)
ST 0,230(0,13) PRM=1
LA 0,008(0,6) DNM=1-139
ST 0,234(0,13) PRM=2
MVI 230(13),X'00' PRM=1
XC 24C(8,13),24C(13) PRM=8 PRM=8
LA 0,001(0,0)
ST 0,244(0,13) PRM=6
LA 0,028(0,12) LIT+0
ST 0,248(0,13) PRM=7
LA 0,001(0,0)
ST 0,23C(0,13) PRM=4
LA 0,029(0,12) LIT+1
ST 0,240(0,13) PRM=5
MVC 238(4,13),02A(12) PRM=3 LIT+2
MVI 250(13),X'80' PRM=9
LA 1,230(0,13) PRM=1
L 15,010(0,12) V(ILBOINS0)
BALR 14,15
L 1,220(0,13) VN=01
BCR 15,1

.... and for the second...

LA 0,001(0,0)
ST 0,230(0,13) PRM=1
LA 0,008(0,6) DNM=1-139
ST 0,234(0,13) PRM=2
MVI 230(13),X'00' PRM=1
XC 24C(8,13),24C(13) PRM=8 PRM=8
LA 0,001(0,0)
ST 0,244(0,13) PRM=6
LA 0,028(0,12) LIT+0
ST 0,248(0,13) PRM=7
LA 0,001(0,0)
ST 0,23C(0,13) PRM=4
LA 0,029(0,12) LIT+1
ST 0,240(0,13) PRM=5
MVC 238(4,13),02A(12) PRM=3 LIT+2
XC 268(8,13),268(13) PRM=15 PRM=15
LA 0,001(0,0)
ST 0,260(0,13) PRM=13
LA 0,02E(0,12) LIT+6
ST 0,264(0,13) PRM=14
LA 0,001(0,0)
ST 0,258(0,13) PRM=11
LA 0,02F(0,12) LIT+7
ST 0,25C(0,13) PRM=12
MVC 254(4,13),02A(12) PRM=10 LIT+2
XC 284(8,13),284(13) PRM=22 PRM=22
LA 0,001(0,0)
ST 0,27C(0,13) PRM=20
LA 0,030(0,12) LIT+8
ST 0,280(0,13) PRM=21
LA 0,001(0,0)
ST 0,274(0,13) PRM=18
LA 0,031(0,12) LIT+9
ST 0,278(0,13) PRM=19
MVC 270(4,13),02A(12) PRM=17 LIT+2
XC 2A0(8,13),2A0(13) PRM=29 PRM=29
LA 0,001(0,0)
ST 0,298(0,13) PRM=27
LA 0,032(0,12) LIT+10
ST 0,29C(0,13) PRM=28
LA 0,001(0,0)
ST 0,290(0,13) PRM=25
LA 0,033(0,12) LIT+11
ST 0,294(0,13) PRM=26
MVC 28C(4,13),02A(12) PRM=24 LIT+2
XC 2BC(8,13),2BC(13) PRM=36 PRM=36
LA 0,001(0,0)
ST 0,2B4(0,13) PRM=34
LA 0,034(0,12) LIT+12
ST 0,2B8(0,13) PRM=35
LA 0,001(0,0)

.... and this kept on going for another five screensful; if someone wants
the whole thing then ask me by email. IBM Enterprise COBOL for z/OS and
OS/390 3.2.0 yielded, for the first and second, respectively:

TR 8(1,2),292(10) CHAR-1

.... and ...

TR 16(80,2),36(10) CHAR-80

DD

Robert Wagner

2004-05-17, 12:30 pm

Try SEARCH on an array of bytes looking for equal to a single value. See whether
it generates a TRT, a loop or a call.

--- history follows ---

docdwarf@panix.com wrote:

>
>All righty... as mentioned the other day I coded:
>
>01 CHAR-1 PIC X.
>01 CHAR-80 PIC X(80).
>
>...
>PROCEDURE DIVISION.
>
> PERFORM INSPECT-1.
> PERFORM INSPECT-80.
> GOBACK.
>INSPECT-1.
> INSPECT CHAR-1 REPLACING ALL 'a' BY 'A'.
>INSPECT-80.
> INSPECT CHAR-80 REPLACING ALL 'a' BY 'A'
> ALL 'b' BY 'B'
> ALL 'c' BY 'C'
> ALL 'd' BY 'D'
> ALL 'e' BY 'E'
> ALL 'f' BY 'F'
> ALL 'g' BY 'G'
> ALL 'h' BY 'H'
> ALL 'i' BY 'I'
> ALL 'j' BY 'J'
> ALL 'k' BY 'K'
> ALL 'l' BY 'L'
> ALL 'm' BY 'M'
> ALL 'n' BY 'N'.
>
>... and compiled. For the first INSPECT OS/VS COBOL gave:
>
>LA 0,001(0,0)
>ST 0,230(0,13) PRM=1
>LA 0,008(0,6) DNM=1-139
>ST 0,234(0,13) PRM=2
>MVI 230(13),X'00' PRM=1
>XC 24C(8,13),24C(13) PRM=8 PRM=8
>LA 0,001(0,0)
>ST 0,244(0,13) PRM=6
>LA 0,028(0,12) LIT+0
>ST 0,248(0,13) PRM=7
>LA 0,001(0,0)
>ST 0,23C(0,13) PRM=4
>LA 0,029(0,12) LIT+1
>ST 0,240(0,13) PRM=5
>MVC 238(4,13),02A(12) PRM=3 LIT+2
>MVI 250(13),X'80' PRM=9
>LA 1,230(0,13) PRM=1
>L 15,010(0,12) V(ILBOINS0)
>BALR 14,15
>L 1,220(0,13) VN=01
>BCR 15,1
>
>... and for the second...
>
>LA 0,001(0,0)
>ST 0,230(0,13) PRM=1
>LA 0,008(0,6) DNM=1-139
>ST 0,234(0,13) PRM=2
>MVI 230(13),X'00' PRM=1
>XC 24C(8,13),24C(13) PRM=8 PRM=8
>LA 0,001(0,0)
>ST 0,244(0,13) PRM=6
>LA 0,028(0,12) LIT+0
>ST 0,248(0,13) PRM=7
>LA 0,001(0,0)
>ST 0,23C(0,13) PRM=4
>LA 0,029(0,12) LIT+1
>ST 0,240(0,13) PRM=5
>MVC 238(4,13),02A(12) PRM=3 LIT+2
>XC 268(8,13),268(13) PRM=15 PRM=15
>LA 0,001(0,0)
>ST 0,260(0,13) PRM=13
>LA 0,02E(0,12) LIT+6
>ST 0,264(0,13) PRM=14
>LA 0,001(0,0)
>ST 0,258(0,13) PRM=11
>LA 0,02F(0,12) LIT+7
>ST 0,25C(0,13) PRM=12
>MVC 254(4,13),02A(12) PRM=10 LIT+2
>XC 284(8,13),284(13) PRM=22 PRM=22
>LA 0,001(0,0)
>ST 0,27C(0,13) PRM=20
>LA 0,030(0,12) LIT+8
>ST 0,280(0,13) PRM=21
>LA 0,001(0,0)
>ST 0,274(0,13) PRM=18
>LA 0,031(0,12) LIT+9
>ST 0,278(0,13) PRM=19
>MVC 270(4,13),02A(12) PRM=17 LIT+2
>XC 2A0(8,13),2A0(13) PRM=29 PRM=29
>LA 0,001(0,0)
>ST 0,298(0,13) PRM=27
>LA 0,032(0,12) LIT+10
>ST 0,29C(0,13) PRM=28
>LA 0,001(0,0)
>ST 0,290(0,13) PRM=25
>LA 0,033(0,12) LIT+11
>ST 0,294(0,13) PRM=26
>MVC 28C(4,13),02A(12) PRM=24 LIT+2
>XC 2BC(8,13),2BC(13) PRM=36 PRM=36
>LA 0,001(0,0)
>ST 0,2B4(0,13) PRM=34
>LA 0,034(0,12) LIT+12
>ST 0,2B8(0,13) PRM=35
>LA 0,001(0,0)
>
>... and this kept on going for another five screensful; if someone wants
>the whole thing then ask me by email. IBM Enterprise COBOL for z/OS and
>OS/390 3.2.0 yielded, for the first and second, respectively:
>
>TR 8(1,2),292(10) CHAR-1
>
>... and ...
>
>TR 16(80,2),36(10) CHAR-80
>
>DD
>


docdwarf@panix.com

2004-05-17, 12:30 pm

In article <40a8d96b.553618373@news.optonline.net>,
Robert Wagner <robert.deletethis@wagner.net> wrote:
>Try SEARCH on an array of bytes looking for equal to a single value. See whether
>it generates a TRT, a loop or a call.


01 A-TABLE PIC X(16000) VALUE SPACES.
01 FILLER REDEFINES A-TABLE.
03 A-TBL OCCURS 16000 INDEXED BY A-INDX.
05 A-CODE PIC X(1).
01 CHAR-1 PIC X.

....

SEARCH A-TBL
AT END
DISPLAY ' AT END'
WHEN A-CODE (A-INDX) = CHAR-1
DISPLAY ' GOT IT'.

....

Search:

BC 15,332(0,11) GN=14(0003D4)
EQU *
L 2,364(0,9) A-INDX
AH 2,30(0,10) PGMLIT AT +18
ST 2,364(0,9) A-INDX
EQU *
L 2,20(0,10) PGMLIT AT +8
C 2,364(0,9) A-INDX
BC 11,362(0,11) GN=8(0003F2)

Display:

L 2,92(0,9) TGTFIXD+92
L 15,44(0,2) V(IGZCDSP )
LA 1,193(0,10) PGMLIT AT +181
BALR 14,15
BC 15,398(0,11) GN=2(000416)

When:

L 2,364(0,9) A-INDX
A 2,300(0,9) BLW=0
L 3,300(0,9) BLW=0
CLC 96(1,2),8(3) A-CODE() CHAR-1
BC 7,320(0,11) GN=15(0003C8)

Display:

L 2,92(0,9) TGTFIXD+92
L 15,44(0,2) V(IGZCDSP )
LA 1,181(0,10) PGMLIT AT +169
BALR 14,15

DD

Warren Simmons

2004-05-17, 4:30 pm

docdwarf@panix.com wrote:

> All righty... as mentioned the other day I coded:
>
> 01 CHAR-1 PIC X.
> 01 CHAR-80 PIC X(80).
>
> ...
> PROCEDURE DIVISION.
>
> PERFORM INSPECT-1.
> PERFORM INSPECT-80.
> GOBACK.
> INSPECT-1.
> INSPECT CHAR-1 REPLACING ALL 'a' BY 'A'.
> INSPECT-80.
> INSPECT CHAR-80 REPLACING ALL 'a' BY 'A'
> ALL 'b' BY 'B'
> ALL 'c' BY 'C'
> ALL 'd' BY 'D'
> ALL 'e' BY 'E'
> ALL 'f' BY 'F'
> ALL 'g' BY 'G'
> ALL 'h' BY 'H'
> ALL 'i' BY 'I'
> ALL 'j' BY 'J'
> ALL 'k' BY 'K'
> ALL 'l' BY 'L'
> ALL 'm' BY 'M'
> ALL 'n' BY 'N'.
>
> ... and compiled. For the first INSPECT OS/VS COBOL gave:
>
> LA 0,001(0,0)
> ST 0,230(0,13) PRM=1
> LA 0,008(0,6) DNM=1-139
> ST 0,234(0,13) PRM=2
> MVI 230(13),X'00' PRM=1
> XC 24C(8,13),24C(13) PRM=8 PRM=8
> LA 0,001(0,0)
> ST 0,244(0,13) PRM=6
> LA 0,028(0,12) LIT+0
> ST 0,248(0,13) PRM=7
> LA 0,001(0,0)
> ST 0,23C(0,13) PRM=4
> LA 0,029(0,12) LIT+1
> ST 0,240(0,13) PRM=5
> MVC 238(4,13),02A(12) PRM=3 LIT+2
> MVI 250(13),X'80' PRM=9
> LA 1,230(0,13) PRM=1
> L 15,010(0,12) V(ILBOINS0)
> BALR 14,15
> L 1,220(0,13) VN=01
> BCR 15,1
>
> ... and for the second...
>
> LA 0,001(0,0)
> ST 0,230(0,13) PRM=1
> LA 0,008(0,6) DNM=1-139
> ST 0,234(0,13) PRM=2
> MVI 230(13),X'00' PRM=1
> XC 24C(8,13),24C(13) PRM=8 PRM=8
> LA 0,001(0,0)
> ST 0,244(0,13) PRM=6
> LA 0,028(0,12) LIT+0
> ST 0,248(0,13) PRM=7
> LA 0,001(0,0)
> ST 0,23C(0,13) PRM=4
> LA 0,029(0,12) LIT+1
> ST 0,240(0,13) PRM=5
> MVC 238(4,13),02A(12) PRM=3 LIT+2
> XC 268(8,13),268(13) PRM=15 PRM=15
> LA 0,001(0,0)
> ST 0,260(0,13) PRM=13
> LA 0,02E(0,12) LIT+6
> ST 0,264(0,13) PRM=14
> LA 0,001(0,0)
> ST 0,258(0,13) PRM=11
> LA 0,02F(0,12) LIT+7
> ST 0,25C(0,13) PRM=12
> MVC 254(4,13),02A(12) PRM=10 LIT+2
> XC 284(8,13),284(13) PRM=22 PRM=22
> LA 0,001(0,0)
> ST 0,27C(0,13) PRM=20
> LA 0,030(0,12) LIT+8
> ST 0,280(0,13) PRM=21
> LA 0,001(0,0)
> ST 0,274(0,13) PRM=18
> LA 0,031(0,12) LIT+9
> ST 0,278(0,13) PRM=19
> MVC 270(4,13),02A(12) PRM=17 LIT+2
> XC 2A0(8,13),2A0(13) PRM=29 PRM=29
> LA 0,001(0,0)
> ST 0,298(0,13) PRM=27
> LA 0,032(0,12) LIT+10
> ST 0,29C(0,13) PRM=28
> LA 0,001(0,0)
> ST 0,290(0,13) PRM=25
> LA 0,033(0,12) LIT+11
> ST 0,294(0,13) PRM=26
> MVC 28C(4,13),02A(12) PRM=24 LIT+2
> XC 2BC(8,13),2BC(13) PRM=36 PRM=36
> LA 0,001(0,0)
> ST 0,2B4(0,13) PRM=34
> LA 0,034(0,12) LIT+12
> ST 0,2B8(0,13) PRM=35
> LA 0,001(0,0)
>
> ... and this kept on going for another five screensful; if someone wants
> the whole thing then ask me by email. IBM Enterprise COBOL for z/OS and
> OS/390 3.2.0 yielded, for the first and second, respectively:
>
> TR 8(1,2),292(10) CHAR-1
>
> ... and ...
>
> TR 16(80,2),36(10) CHAR-80
>
> DD
>


Hi DD,

Does TR stand for Transfer and Return?
If so, it's the same as the Univac I RU!

Warren Simmons
Robert Wagner

2004-05-17, 5:30 pm

docdwarf@panix.com wrote:

>In article <40a8d96b.553618373@news.optonline.net>,
>Robert Wagner <robert.deletethis@wagner.net> wrote:
whether
[color=darkred]
>Search:
> [loop code snipped]


Thanks. It's not 'optimized' like INSPECT.

Twenty years ago, Realia produced the PC equivalent of TRT.
docdwarf@panix.com

2004-05-17, 7:30 pm

In article <40A90DB5.3020001@optonline.net>,
Warren Simmons <wsimmons5@optonline.net> wrote:
>docdwarf@panix.com wrote:


[snip]

>
>Hi DD,
>
>Does TR stand for Transfer and Return?


One moment, Mr Simmons... ahhhhhh, here it is, right where it is always
handy... according to the System/370 Reference Summary, GX20-1850-6, File
No. S370/4300-1, Seventh Edition (July 1986), Page 8...

.... mnemonic TR has operands D1(L,B1),D2(B2) (all numerics are
subscripted), the name Translate, format SS and Op Code DC and nothing
classy or noteworthy.

DD
LX-i

2004-05-17, 9:30 pm

docdwarf@panix.com wrote:
> ... and this kept on going for another five screensful; if someone wants
> the whole thing then ask me by email. IBM Enterprise COBOL for z/OS and
> OS/390 3.2.0 yielded, for the first and second, respectively:
>
> TR 8(1,2),292(10) CHAR-1
>
> ... and ...
>
> TR 16(80,2),36(10) CHAR-80


and this was the difference between COBOL 74 and COBOL 85?


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ LXi0007@Netscape.net ~
~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ I do not read e-mail at the above address ~
~ Please see website if you wish to contact me privately ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~

docdwarf@panix.com

2004-05-17, 10:30 pm

In article <10ainhag2a0b0e7@corp.supernews.com>,
LX-i <lxi0007@netscape.net> wrote:
>docdwarf@panix.com wrote:
>
>and this was the difference between COBOL 74 and COBOL 85?


It is unclear what you are referring to. This posting originally
contained extracts of four listings, both labelled by compiler; what you
have included above is labelled as coming from IBM Enterprise COBOL etc.
compiles.

DD

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com