IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Calling Sub programs


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 11:46 am
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
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: 1287
Location: Chennai, India

PostPosted: Tue Aug 12, 2008 12:11 pm
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
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: 2146
Location: At my coffee table

PostPosted: Tue Aug 12, 2008 12:33 pm
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
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: 6966
Location: porcelain throne

PostPosted: Tue Aug 12, 2008 1:27 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top