Solved

AS/400 COBOL - how to read Data Area

Posted on 2001-07-23
8
2,412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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