Solved

AS/400 COBOL - how to read Data Area

Posted on 2001-07-23
8
2,311 Views
Last Modified: 2007-12-19
Is there anyone can help me with the syntax and
 possibly an explanation how to read Data Area on AS/400 using COBOL. If possible I would like to see an exemple of code. Please, I need an aswer as soon as possible.
0
Comment
Question by:Elena
8 Comments
 
LVL 2

Expert Comment

by:olidel
ID: 6309989
Hi,

   Is it not possible for you to do a CALL to QCMDEXC from your Cobol program so you can use the RTVDTAARA command. You just have to declare 2 variables : The first one should contain the command to be processed by the QCMDEXC program. The second variable should be define as a 15,5 packed digits. This variable should contain the real lenght of the command that you give to QCMDEXC.

Hope this help.

Bye



0
 
LVL 2

Accepted Solution

by:
xinger earned 50 total points
ID: 6310847
I think you will need to create a CL program in which you embed your RTVDTAARA command, and then call that CL program from your COBOL program.  Here's a very simple sample program:

PGM PARM(&DATAVALUE)
DCL VAR(&DATAVALUE) TYPE(*CHAR) LEN(10)
RTVDTAARA DTAARA(MYDATAAREA) VAR(&DATAVALUE)
END

and then in your COBOL program:

01  DATAVALUE PIC X(10).
CALL "CLPROGRAM" USING DATAVALUE.

I'm not 100% confident on the syntax above, but I think you can get the idea of what is needed.
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 6311408
As far as I know, You can read and write data to an DATA-AREA exactly the same way as you do this for your LOCAL-DATA-AREA (with DISPLAY and ACCEPT).
This is only functioning when the data area is already opened in a previous step.
(So actually it is more like reading a 1 record file.)


0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 6441020
Hi Elena,

Is it not working, or have you stoped thinking about us??
:-)
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6890893
Help requested, reponses provided and still open today.  Please return to your open questions and update/finalize them.

EXPERTS PLEASE HELP ME DECIDE THE FAIR OUTCOME FOR THIS QUESTION, if it remains open another seven (7) days, since we will need to finalize it.

Thank you,
Moondancer - EE Moderator
0
 
LVL 3

Expert Comment

by:P_S_Price
ID: 7149104
Give the Ponts to Murphey
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 7150799
Thaks PSP
0
 
LVL 33

Expert Comment

by:shalomc
ID: 8961794
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept xinger's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ShalomC
EE Cleanup Volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
Some of the SEO trends we might expect in 2017.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question