MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reference mod in Cobol work diffent in CICS v/s batch

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
powerhawk
Beginner


Joined: 08 Nov 2004
Posts: 28
Topics: 4
Location: Stockholm

PostPosted: Mon Nov 08, 2004 10:03 am    Post subject: Reference mod in Cobol work diffent in CICS v/s batch Reply with quote

I'm using z/OS Cobol 3.1. Reference modification without length, like W-DATA(W-POS:), executes much slower (consuming much more CPU, MUCH MORE) in CICS programs than in batch. Any explanation to this?
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Mon Nov 08, 2004 10:17 am    Post subject: Reply with quote

Powerhawk,

It is very simple. A reference modification without the length specification generates 7 assembler instructions.

When you specify the length it only generates 3 assembler istructions. You can check that with compiling your pgm with LIST option.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Mon Nov 08, 2004 10:48 am    Post subject: Reply with quote

Kolusu, I think you may have misread the question - what Powerhawk is saying is that the same ref mod without length executes much slower in CICS than batch, not that it's slower than ref mod with length specified.

I think depending on the operands, in some cases ref mod might generate a call to a runtime routine rather than inline code. And the CICS runtime modules are different to the batch ones, and might (for example) be doing a CICS GETMAIN where the batch version used a fixed work area or did a less expensive MVS GETMAIN. This could account for a large difference.
Back to top
View user's profile Send private message
powerhawk
Beginner


Joined: 08 Nov 2004
Posts: 28
Topics: 4
Location: Stockholm

PostPosted: Mon Nov 08, 2004 10:49 am    Post subject: Reply with quote

Yes, I accept it's faster with the length specified. But why is it differences between CICS and batch? The background to my question is this.

I did some optimizing measures in a frequently used subrutin, including some code using reference modification without length. I implemented the optimized subrutin in a batch program and save one hour of execution time. The subrutin became three times faster and consumed less CPU time. When I implemented the new subrutin version in a CICS program. The new version became slower and consumed 150% more CPU than before. When I modified the subrutin and used length specification the batch program run 1-2% faster but the CICS program consume much less CPU comparing to the version without length specification. That is strange!
Back to top
View user's profile Send private message Send e-mail
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Mon Nov 08, 2004 10:52 am    Post subject: Reply with quote

Powerhawk, I guess you were preparing your post while I was doing mine; anyhow see above and if you want to take it further, post the assmebler code generated as per Kolusu's comment about LIST.
Back to top
View user's profile Send private message
powerhawk
Beginner


Joined: 08 Nov 2004
Posts: 28
Topics: 4
Location: Stockholm

PostPosted: Tue Nov 09, 2004 3:24 am    Post subject: Reply with quote

The assembler code for the reference modification statement without length
Code:

PERFORM UNTIL (A-RAD > 9)
OR A-TEXTFALT(A-POS:) = SPACE OR LOW-VALUE

is
Code:

BAL  14,318(0,9)             TGT TEST INFORMATION AREA +10
EQU  *                                                     
EQU  *                                                     
LH   2,8(0,10)               A-POS                         
CVD  2,392(0,13)             TS2=0                         
CVB  2,392(0,13)             TS2=0                         
L    3,60(0,8)               PGMLIT AT +12                 
SR   3,2                                                   
LA   4,831(2,10)             A-TEXTFALT()                 
LR   6,4                                                   
LR   5,3                                                   
L    7,64(0,8)               PGMLIT AT +16                 
CLCL 4,6                                                   
L    11,12(0,12)             PBL=1                         
BC   8,1028(0,11)            GN=9(000808)                 
LH   2,8(0,10)               A-POS                         
CVD  2,392(0,13)             TS2=0                         
CVB  2,392(0,13)             TS2=0                         
L    3,60(0,8)               PGMLIT AT +12                 
SR   3,2                                                   
LA   4,831(2,10)             A-TEXTFALT()                 
LR   6,4                                                   
LR   5,3                                                   
L    7,80(0,8)               PGMLIT AT +32                 
CLCL 4,6                                                   
BC   7,1032(0,11)            GN=112(00080C)               
EQU  *                                                     
BC   15,1070(0,11)           GN=110(000832)               
EQU  *                                                     
BAL  14,316(0,9)             TGT TEST INFORMATION AREA +8 
EQU  *                                                     

The assembler code for the reference modification statement with length
Code:

PERFORM UNTIL (A-RAD > 9)
OR A-TEXTFALT(A-POS:A-LGD) = SPACE OR LOW-VALUE

is
Code:

BAL  14,318(0,9)             TGT TEST INFORMATION AREA +10
EQU  *                                                   
EQU  *                                                   
LH   2,8(0,10)               A-POS                       
CVD  2,392(0,13)             TS2=0                       
CVB  2,392(0,13)             TS2=0                       
LH   3,10(0,10)              A-LGD                       
CVD  3,392(0,13)             TS2=0                       
CVB  3,392(0,13)             TS2=0                       
LA   4,831(2,10)             A-TEXTFALT()                 
LR   6,4                                                 
LR   5,3                                                 
L    7,60(0,8)               PGMLIT AT +12               
CLCL 4,6                                                 
L    11,16(0,12)             PBL=1                       
BC   8,1234(0,11)            GN=9(0008DE)                 
LH   2,8(0,10)               A-POS                       
CVD  2,392(0,13)             TS2=0                       
CVB  2,392(0,13)             TS2=0                       
LH   3,10(0,10)              A-LGD                       
CVD  3,392(0,13)             TS2=0                       
CVB  3,392(0,13)             TS2=0                       
LA   4,831(2,10)             A-TEXTFALT()                 
LR   6,4                                                 
LR   5,3                                                 
L    7,76(0,8)               PGMLIT AT +28               
CLCL 4,6                                                 
BC   7,1238(0,11)            GN=112(0008E2)               
EQU  *                                                   
BC   15,1302(0,11)           GN=110(000922)               
EQU  *                                                   
BAL  14,316(0,9)             TGT TEST INFORMATION AREA +8
EQU  *
Back to top
View user's profile Send private message Send e-mail
powerhawk
Beginner


Joined: 08 Nov 2004
Posts: 28
Topics: 4
Location: Stockholm

PostPosted: Tue Nov 09, 2004 4:15 am    Post subject: Reply with quote

I'm a little bit worried about this effect in CICS environment. We have a lot of CICS programs using reference mod without length. The field used here, A-TEXTFALT, is 800 bytes long. Maybe the reference mod works better with shorter fields. I hope so!
Back to top
View user's profile Send private message Send e-mail
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Sat Nov 13, 2004 2:47 am    Post subject: Reply with quote

Powerhawk,

the generated code looks a bit strange to me. Specifically, I curious about the BAL with the reference to the TEST INFORMATION AREA. Perhaps you have compiled with the SSRANGE option and the run time option CHECK is set differently in batch vs. CICS. Another thing to check is to see if you have the WITH DEBUGGING MODE specified on the SOURCE-COMPUTER statement.

please post you compiler options
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
powerhawk
Beginner


Joined: 08 Nov 2004
Posts: 28
Topics: 4
Location: Stockholm

PostPosted: Mon Nov 15, 2004 7:13 am    Post subject: Reply with quote

Both in CICS and batch we have NOSSRANGE.
The differences in compile options are:
CICS - NODYNAM, OPTIMIZE(FULL), NOTEST
Bach - DYNAM, NOOPTIMIZE, TEST(ALL,SYM)
The subprogram with the strange source code is compiled as a batch program.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group