Solved

AS/400 COBOL - how to read Data Area

Posted on 2001-07-23
8
2,277 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
php iseries 3 227
Check Group Membership 2 122
AS400 Forms 9 122
Create AS400 Logical File 5 79
If you thought ransomware was bad, think again! Doxware has the potential to be even more damaging.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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