Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Calling Sub programs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Sunilkumarsaini

New User


Joined: 25 Jul 2008
Posts: 13
Location: chandigarh

PostPosted: Tue Aug 12, 2008 11:03 am    Post subject: Calling Sub programs
Reply with quote

Hi,

I was analysing a program ans found that calling program which should pass two variables with Using Clause is passing on only one with one comma as given below:-

CALL 'RS0MADR3' USING REAS-WINDOW-ALPHA-TEMP ( 1) ,

But progrm RS0MADR3 is recieving two variables in linkage section.

Is there any default value after comma which is passed if we don't give it explicitly.

thanks
Saini
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 11:46 am    Post subject:
Reply with quote

looks like someone deleted a source line.
Back to top
View user's profile Send private message
Sunilkumarsaini

New User


Joined: 25 Jul 2008
Posts: 13
Location: chandigarh

PostPosted: Tue Aug 12, 2008 11:59 am    Post subject:
Reply with quote

nope I am compiling it and it is not giving any compilation error.

below is the actual code :-

Code:
             CALL 'RS0Y4DR3' USING WS-COMPARE-DATE , REAS-WIND-OFF     
              MOVE 901231 TO REAS-WINDOW-ALPHA-TEMP ( 1)               
             CALL 'RS0MADR3' USING REAS-WINDOW-ALPHA-TEMP ( 1) , --------> I am talking about this line     
      *       IF (WS-COMPARE-DATE GREATER THAN 901231) AND             
              IF (WS-COMPARE-DATE GREATER THAN REAS-WINDOW-ALPHA-TEMP (   1)) AND
                 (WS-RETIREMENT-YEARS LESS THAN 75)                     
                 CALL 'RS0Y4DD3' USING WS-COMPARE-DATE , REAS-WIND-OFF 
                 PERFORM 4000-SAFE-HARBOR                               
                    THRU 4000-SAFHRBR-EXIT                             
                 GO TO 2310-PREPARE-RECORD-DATES-EXIT                   
               ELSE CALL 'RS0Y4DD3' USING WS-COMPARE-DATE ,             
                      REAS-WIND-OFF.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Aug 12, 2008 12:11 pm    Post subject: Reply to: Calling Sub programs
Reply with quote

Sunil,

Quote:
But progrm RS0MADR3 is recieving two variables in linkage section.


What is the value in the received field? Is it spaces?
Back to top
View user's profile Send private message
Sunilkumarsaini

New User


Joined: 25 Jul 2008
Posts: 13
Location: chandigarh

PostPosted: Tue Aug 12, 2008 12:16 pm    Post subject:
Reply with quote

Aaru,

I am not able to run this because I don't have proper set up for this. I need to give analysyis only. So is it possible is this syntex acceptable??
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Aug 12, 2008 12:33 pm    Post subject:
Reply with quote

IIRC, the called program needs to check the address of the second parm before using it. If it is null, do not reference the data area.

BTW, a comma on a COBOL line means nothing.
Back to top
View user's profile Send private message
Sunilkumarsaini

New User


Joined: 25 Jul 2008
Posts: 13
Location: chandigarh

PostPosted: Tue Aug 12, 2008 1:00 pm    Post subject:
Reply with quote

could you please explain this littele bit more
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 1:27 pm    Post subject:
Reply with quote

if RS0MADR3 (the CALLed program)
does not insure that there is addressability to the second parm,
but instead references to the second parameter are made as if the parm was provided,

you have lost a source line in the CALL.

If RS0MADR3 does indeed insure addressability of the second parm, then the CALL syntax, though irregular, is correct.
Back to top
View user's profile Send private message
Meir Goldstein

New User


Joined: 12 May 2008
Posts: 7
Location: Jerusalem, israel

PostPosted: Tue Aug 12, 2008 6:41 pm    Post subject:
Reply with quote

Hi sunil!
The list of the parameters is tranlated to a list of words(4 bytes), each word contains the address of the corresponding par. the last word in the list contains in the high order bit, of the first byte from left, is on.
so everything is perfect if the called program check this bit to look if this is the last parameter passed to it otherwise it will get garbage.
best tiding.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Why myself doing Package Bind always ... Susanta DB2 5 Thu Mar 02, 2017 10:47 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us