Is it possible to declare a GDA for an external subroutine?

Answer Posted / jamil ahmad

YES. A GDA can be used in an external subroutine. Thats
where a GDA comes in real handy. I personally rather use a
subprogram but developers use subroutine and like it. You
dont have to pass any parameter but you must use the GDA.
Upon returning from the subroutine you can interrogate the
glbal fields for your edits. Here is an example of an
external subroutine (chopped off to fit here): (I didnt
write this but use it all the time, works perfect)
DEFINE DATA
GLOBAL USING DSLGLOB
LOCAL
1 #NAME (A15) INIT <' '>
1 REDEFINE #NAME
2 #ARRAY (A1/15)
1 #X (N2)
1 #LENGTH (N2)
1 #BLANK (A1) INIT <'N'>
END-DEFINE
***********************************************
DEFINE SUBROUTINE NAME-EDIT
***********************************************
ETC ETC

END-SUBROUTINE

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain is it possible to code goto statement in natural? If yes please provide the syntax of the same?

592


What is the difference between read work file 1 and read work file once? Why we are using work file once?

526


Explain how to ftp the natural program to desktop? (From mainframe to pc), is it possible?

591


Explain difference between read(1) and read work file once?

553


Explain how are you going to remove duplicates from the file that is being read?

547






Explain the data storage?

554


How to find occurrence of mu and pe fields in a file?

484


Can we see the copy book length using file-aid?

494


Suppose you are processing an input file in a natural program and you want the program to fail if the file is empty. What command you use in natural to force it to fail?

568


Explain how to receive data passed through jcl parm parameter in a natural program? How data definition is defined in the program?

610


Explain the difference between external subroutine and subprogram?

609


Define cobol coding sheet?

564


What is data trace system 2.0 used for?

5149


How can we see the copy book length using file-aid?

545


Explain control variable in online screens?

551