× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: Working with DataArea in COBOL
  • From: "Amjad Zamil" <amjadz@xxxxxxxxxx>
  • Date: Wed, 14 Mar 2001 10:57:58 +0300
  • Importance: Normal

Geir,
 
 Thank you alot for the detailed mail.I have a question regarding EXAMPLE1 in :
 
    RTVDTAARA  DTAARA(EXAMPLE1 (1 3)) RTNVAR(&VAR1)
 I don't see any reference for it anywhere else ?
 
 Regards
 
 Amjad
-----Original Message-----
From: owner-cobol400-l@midrange.com [mailto:owner-cobol400-l@midrange.com]On Behalf Of geir.kildal@entragroup.com
Sent: Wednesday, March 14, 2001 12:01 PM
To: COBOL400-L@midrange.com
Subject: RE: Working with DataArea in COBOL


OK, here we go....

Dataareas are areas on the AS/400 where you can store and retrieve small data amounts.  On a command-line on the AS/400, type GO CMDDTAARA, and you will see the commands availible for dataareas.

In connection to programs(COBOL, RPG etc) the data areas are often created(CRTDTAARA), updatedCHGDTAARA) and read(RTVDTAARA) in CL's.  If you, in editing a CL-program, key in f.ex. RTVDTAARA and then press cmd-4(promt), you will get up the possible parameters for this command.  Try it.

Here is an example on a CL-program:

 PGM

 DCL        VAR(&VAR1) TYPE(*CHAR) LEN(3)
 DCL        VAR(&VAR2) TYPE(*CHAR) LEN(2)
 DCL        VAR(&VAR3) TYPE(*CHAR) LEN(1)

 RTVDTAARA  DTAARA(EXAMPLE1 (1 3)) RTNVAR(&VAR1)
 RTVDTAARA  DTAARA(EXAMPLE1 (4 2)) RTNVAR(&VAR2)
 RTVDTAARA  DTAARA(EXAMPLE1 (6 1)) RTNVAR(&VAR3)


 CALL       PGM(CBLPGM1) PARM(&VAR1 &VAR2 &VAR3)

 ENDPGM

Here is an example of how LINKAGE SECTION and the PROCEDURE DIVISION should be defined if this program is to be called from the example CL-program:

 LINKAGE SECTION.
 01  L-PARAM-1                    PIC X(3).
 01  L-PARAM-2                    PIC XX.
 01  L-PARAM-3                    PIC X.

 PROCEDURE DIVISION USING L-PARAM1 L-PARAM-2 LPARAM-3.
 MAIN SECTION.
 MAIN-000.
     PERFORM A-SOMETHING.
     ETC. ETC.
     PERFORM X-EXIT.
     GOBACK.
 MAIN-999-EXIT.
     EXIT.








Mvh.

Geir




"Amjad Zamil" <amjadz@sts.com.jo>
Sent by: owner-cobol400-l@midrange.com

14.03.01 07:27
Please respond to COBOL400-L

       
        To:        <COBOL400-L@midrange.com>
        cc:        
        Subject:        RE: Working with DataArea in COBOL




Geir,
 
 I appreciate it if you can send me an example (CL +  COBOL).
 Thanks alot.
 
 Best  Regards
 
 Amjad
-----Original Message-----
From:  owner-cobol400-l@midrange.com [mailto:owner-cobol400-l@midrange.com]On  Behalf Of geir.kildal@entragroup.com
Sent: Tuesday, March 13,  2001 4:04 PM
To: COBOL400-L@midrange.com
Subject: RE:  Working with DataArea in COBOL



Amjad.

It's quite 'normal'  to use a data area to pass parameters, but the dataarea must be read by a  CL-program, and that program must pass the content to the COBOL program as a  parameter(or parameters).  You must know how to use parameters in a COBOL  program(LINKAGE SECTION and PROCEDURE DIVISION USING ....etc etc.).  If  you don't know how, you have to look it up in a manual, or I can send you an  example..


Mvh.

Geir




"Amjad Zamil"  <amjadz@sts.com.jo>
Sent by: owner-cobol400-l@midrange.com  

12.03.01 17:06
Please respond to COBOL400-L
       
        To:         <COBOL400-L@midrange.com>
        cc:         
         Subject:        RE: Working with  DataArea in COBOL




Geir,
 
 Thanx for your  reply.Right now,I'm not using DataArea  within the COBOL code that's  wun on the AS/400.I just  went
 through reading about the issue from internet resources and found   alot pointing to DataArea as a key to solve this
 problem.I can write a totally new sample COBOL  program that meets  with whatever modifications/requiremetns that  
 I should do to use DataArea if this's  really the correct way to go  including the required CL to build and  use,as well.
 
Best  Regards
 
 Amjad Zamil  
-----Original Message-----
From:  owner-cobol400-l@midrange.com  [mailto:owner-cobol400-l@midrange.com]On  Behalf Of  geir.kildal@entragroup.com
Sent: Monday, March 12,  2001 6:35 PM
To: COBOL400-L@midrange.com
Subject: Re:  Working with DataArea in  COBOL



Amjad.

First of  all, I  would check to see if the COBOL-program is expecting parameters  in the call.   You mention DataAreas, they are usually read in a  CL-program, whitch   can call a COBOL-program.  


Mvh.

Geir Kildal   
Entra Data AS  




"Amjad Zamil"   <amjadz@sts.com.jo>  
Sent by:  owner-cobol400-l@midrange.com   

12.03.01  14:10
Please respond to COBOL400-L
         
        To:          "Cobol400 Mailing List"   <COBOL400-L@midrange.com>
         cc:         
          Subject:        Working with DataArea  in  COBOL



Hi,

 I'm totally new to   AS/400 environment.I have searched through the mailing  
list archives  for
information regarding my problem but couldn't find a clear   answer.

 I have a Sun server  running  Solaris 7 with SNAP-IX installed and configured  
to set an  Lu6.2
connection to AS/400 server.I managed to test the connectivity with   the
AS/400 server and  
it's working ok.The problem is that I have a small   cobol program that runs
on AS/400  and
I need to pass some parameters   in/out to/from it from my SNAP-IX server and
when I check
the AS/400   log,I find that the cobol program was called but get an   error
saying
"missing parameters".I think the problem is mainly related  to  the way the
cobol program  
is dealing with the  DataArea.  

 I appreciate it if someone  can provide me  with the typical way a COBOL
program should  work
with the  DataArea and whatever  pre-steps on the operating system level that
should  be done.

 Thanks alot in  advance.

 Best  Regards

 Amjad Zamil <  amjadz@sts.com.jo >  

+---
| This is   the COBOL/400 Mailing List!
| To submit  a new message, send your mail to  COBOL400-L@midrange.com.  
| To subscribe to this list send email to   COBOL400-L-SUB@midrange.com.
| To  unsubscribe from this list send email to   COBOL400-L-UNSUB@midrange.com.
|  Questions should be directed to the list  owner/operator:  david@midrange.com
+---END    







As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.