Linkage Section Usage



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Linkage Section Usage

Postby balaji_07ece » Wed Jan 18, 2012 4:19 pm

How to Code the Linkage Section of a Cobol program ??

I want to write a new Cobol program which Should run Daily, Weekly and Monthly using the Proc as and when required. I know it is posiible, if we efficiently use the Linkage Section. But I don't know how to use the Linkage Section efficiently in such a way.

Can Someone explain me how to Code the Linkage section in the Cobol Program for the above mentioned Criteria ??
Thanks & Regards
Balaji.R
balaji_07ece
 
Posts: 2
Joined: Wed Jan 18, 2012 4:03 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: Linkage Section Usage

Postby BillyBoyo » Wed Jan 18, 2012 4:41 pm

Are you saying your program will be executed from a PROC which will supply a PARM to your program to indicate the type of run?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Linkage Section Usage

Postby Robert Sample » Wed Jan 18, 2012 5:17 pm

The first issue is that I don't think "efficiently" means what you think it means. From http://www.thefreedictionary.com
ef·fi·cient (-fshnt)
adj.
1. Acting directly to produce an effect: an efficient cause. See Synonyms at effective.
2.
a. Acting or producing effectively with a minimum of waste, expense, or unnecessary effort.
b. Exhibiting a high ratio of output to input.
Since a LINKAGE SECTION merely describes a memory area being passed from another program, why would you think you need to minimize waste, expense, or unnecessary effort (1 and 2b of the definition don't apply in this case)?

The second issue is that the ONLY way you code a LINKAGE SECTION is to define the data being passed to the program -- period. There may be external restrictions (i.e., if you're passing a parameter from JCL you're limited to 100 characters) but you should not be concerned with anything except how the data fields are defined in the LINKAGE SECTION.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Linkage Section Usage

Postby balaji_07ece » Wed Jan 18, 2012 6:26 pm

Hi BillyBoyo,

Yes, You are correct my program will be executed by a PROC which will supply a PARM to indicate the type of run.

Now I want to know how to code the LINKAGE SECTION...
Thanks & Regards
Balaji.R
balaji_07ece
 
Posts: 2
Joined: Wed Jan 18, 2012 4:03 pm
Location: Chennai
Has thanked: 0 time
Been thanked: 0 time

Re: Linkage Section Usage

Postby BillyBoyo » Wed Jan 18, 2012 6:33 pm

LINKAGE SECTION.                                         
01  PARM-FROM-JCL.                                                         
    05 PFJ-LENGTH            PIC S9(04) COMP.                             
    05 PFJ-VALUE.
       10 FILLER OCCURS 0 TO 100 TIMES
             DEPENDING ON PFJ-LENGTH.
          15  FILLER   PIC X.
PROCEDURE DIVISION USING PARM-FROM-JCL.               


Validate the PFJ-LENGTH against the possible lengths you are expecting.

MOVE PFJ-VALUE to use that value specified in the PARM.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post