Discussion:
How to copy a data area (with one simple command)?
(too old to reply)
Peter_Vidal-/
2010-10-01 12:36:13 UTC
Permalink
Hi list!

I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.

TIA and HAPPY FRIDAY to all!


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Michael Ryan
2010-10-01 13:24:08 UTC
Permalink
CRTDTAARA DTAARA(MICHAEL/BLAH) TYPE(*CHAR) LEN(4) VALUE(BLAH)
...
CRTDUPOBJ OBJ(BLAH) FROMLIB(MICHAEL) OBJTYPE(*DTAARA) NEWOBJ(BLAH2)
DSPDTAARA DTAARA(MICHAEL/BLAH2)
Data area . . . . . . . : BLAH2
Library . . . . . . . : MICHAEL
Type . . . . . . . . . : *CHAR
Length . . . . . . . . : 4
Text . . . . . . . . . :

Value
Offset *...+....1....+....2....+....3....+....4....+....5
0 'BLAH'
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Michael Ryan
2010-10-01 13:25:09 UTC
Permalink
Oh...existing...queue Emily Litela...
Post by Michael Ryan
CRTDTAARA DTAARA(MICHAEL/BLAH) TYPE(*CHAR) LEN(4) VALUE(BLAH)
...
CRTDUPOBJ OBJ(BLAH) FROMLIB(MICHAEL) OBJTYPE(*DTAARA) NEWOBJ(BLAH2)
DSPDTAARA DTAARA(MICHAEL/BLAH2)
Data area . . . . . . . : BLAH2
Library . . . . . . . : MICHAEL
Type . . . . . . . . . : *CHAR
Length . . . . . . . . : 4
Value
Offset *...+....1....+....2....+....3....+....4....+....5
0 'BLAH'
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Charles Wilt
2010-10-01 14:29:51 UTC
Permalink
Ok I missed the second "existing" also....

Charles
Post by Michael Ryan
Oh...existing...queue Emily Litela...
Post by Michael Ryan
CRTDTAARA DTAARA(MICHAEL/BLAH) TYPE(*CHAR) LEN(4) VALUE(BLAH)
...
CRTDUPOBJ OBJ(BLAH) FROMLIB(MICHAEL) OBJTYPE(*DTAARA) NEWOBJ(BLAH2)
DSPDTAARA DTAARA(MICHAEL/BLAH2)
Data area . . . . . . . :   BLAH2
  Library . . . . . . . :     MICHAEL
Type  . . . . . . . . . :   *CHAR
Length  . . . . . . . . :   4
           Value
Offset      *...+....1....+....2....+....3....+....4....+....5
    0      'BLAH'
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Peter_Vidal-/
2010-10-01 13:50:29 UTC
Permalink
Guys:

To bring more clarity to my scenario, here I go:

Source Data Area: ABC123 in LIBRARY1
Length: 7/0
Value: 1101001

Target Data Area: ABC123 in LIBRARY2
Length: 7/0
Value: 1100815

The expected result is to have the target data area with the value
1101001.

I know that can create a CLP or a CMD but I wanted to research first to
see if there is a way to do this with one simple command.


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Charles Wilt
2010-10-01 13:34:00 UTC
Permalink
CRTDUPOBJ?

Charles
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Peter_Vidal-/
2010-10-01 13:51:28 UTC
Permalink
I cannot use CRTDUPOBJ because the data area already exist in the target
library.


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Vern Hamberg
2010-10-01 14:14:00 UTC
Permalink
Well, Charles, he did say contents, not the object, right? That's how
I read it and responded - see my reply for an idea.

We do this with data areas in our products - RTVDTAARA/CHGDTAARA
combination - of course, we know the attributes of the data areas.
Therein lies the rub, it seems.

Vern
Post by Charles Wilt
CRTDUPOBJ?
Charles
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------
This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.
--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Barbara Morris
2010-10-01 18:12:20 UTC
Permalink
Post by Vern Hamberg
...
We do this with data areas in our products - RTVDTAARA/CHGDTAARA
combination - of course, we know the attributes of the data areas.
Therein lies the rub, it seems.
The QWCRDTAA (Retrieve Data Area) API can be used to retrieve the
attributes and content of the source data area.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Vern Hamberg
2010-10-01 22:46:14 UTC
Permalink
Excellent! Will remember, there's always an API for it, in the future!

Thanks
Vern
Post by Barbara Morris
Post by Vern Hamberg
...
We do this with data areas in our products - RTVDTAARA/CHGDTAARA
combination - of course, we know the attributes of the data areas.
Therein lies the rub, it seems.
The QWCRDTAA (Retrieve Data Area) API can be used to retrieve the
attributes and content of the source data area.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Richard Casey
2010-10-01 13:43:40 UTC
Permalink
Peter,

I thought the following CPY command would work

CPY OBJ('/QSYS.LIB/fromlib.LIB/fromarea.DTAARA')
TOOBJ('/QSYS.LIB/tolib.LIB/toarea.DTAARA')
REPLACE(*YES)

but I get an "Information passed to this operation was not valid." message
if the "toarea" data area exists.

Of course CRTDUPOBJ complains that "toarea" already exists!

If you are going to be doing this a lot, you could create your own command
that would delete the "toarea" if it existed, and then do the CRTDUPOBJ.

Have fun!

Richard





-----Original Message-----
From: midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
[mailto:midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org] On Behalf Of Peter_Vidal-/***@public.gmane.org
Sent: Friday, October 01, 2010 8:36 AM
To: midrange-l-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Subject: How to copy a data area (with one simple command)?

Hi list!

I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in one
single command.

TIA and HAPPY FRIDAY to all!


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development 10540 Ridge Rd., Suite 203,
New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
----------------------------------------------------------------------------
----

Attention:

This communication may contain information that is confidential, privileged
and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender immediately
and delete the original, all attachments, and all copies of this
communication.


----------------------------------------------------------------------------
----



****************************************************************************
********
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals & computer viruses.
****************************************************************************
********
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Peter_Vidal-/
2010-10-01 13:58:54 UTC
Permalink
Hi Richard:

CPY OBJ('/QSYS.LIB/fromlib.LIB/fromarea.DTAARA')
TOOBJ('/QSYS.LIB/tolib.LIB/toarea.DTAARA')
REPLACE(*YES)

I believe that this is more design to manipulate files maybe? I am
concluding that due to the CCSID parameters I see as part of the
command...

Some command configuration like the one you just showed is the type of
solution I was looking into.

Something along the lines of: CPYDTAARA DTAARA(ABC123) FROMLIB(LIBRARY1)
TOLIB(LIBRARY2)

That will be cool...


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Vern Hamberg
2010-10-01 14:16:49 UTC
Permalink
CPY doesn't work with data areas at all, so far as I can tell - I
tried to CPY a data area to an IFS file, similarly to what you can do
with a user space. I also tried DSPF on a data area - no go - try it on
a user space - fantastic!

I don't think he wants to dupe the object, he wants to work with content
- might want to put it in a data area of a different size.
Post by Richard Casey
Peter,
I thought the following CPY command would work
CPY OBJ('/QSYS.LIB/fromlib.LIB/fromarea.DTAARA')
TOOBJ('/QSYS.LIB/tolib.LIB/toarea.DTAARA')
REPLACE(*YES)
but I get an "Information passed to this operation was not valid." message
if the "toarea" data area exists.
Of course CRTDUPOBJ complains that "toarea" already exists!
If you are going to be doing this a lot, you could create your own command
that would delete the "toarea" if it existed, and then do the CRTDUPOBJ.
Have fun!
Richard
-----Original Message-----
Sent: Friday, October 01, 2010 8:36 AM
Subject: How to copy a data area (with one simple command)?
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in one
single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development 10540 Ridge Rd., Suite 203,
New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
----------------------------------------------------------------------------
----
This communication may contain information that is confidential, privileged
and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender immediately
and delete the original, all attachments, and all copies of this
communication.
----------------------------------------------------------------------------
----
****************************************************************************
********
This footnote confirms that this email message has been scanned by PineApp
Mail-SeCure for the presence of malicious code, vandals& computer viruses.
****************************************************************************
********
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Morgan, Paul
2010-10-01 13:43:07 UTC
Permalink
Peter,

I think you'd have to do a RTVDTAARA/CHGDTAARA pair to copy the contents. If you're worried about data area changes during the copy you could lock the data areas during the copy with ALCOBJ. You could put this in a separate CL program and write a Command front end to make your own single command to do the copy.

Paul

Principal Programmer Analyst
IS Supply Chain/Replenishment
508-253-3934

-----Original Message-----
From: midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org [mailto:midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org] On Behalf Of Peter_Vidal-/***@public.gmane.org
Sent: Friday, October 01, 2010 8:36 AM
To: midrange-l-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Subject: How to copy a data area (with one simple command)?

Hi list!

I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.

TIA and HAPPY FRIDAY to all!


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Vern Hamberg
2010-10-01 14:14:55 UTC
Permalink
What if he doesn't know the attributes of the source data area? More
of a challenge, eh?

Vern
Post by Richard Casey
Peter,
I think you'd have to do a RTVDTAARA/CHGDTAARA pair to copy the contents. If you're worried about data area changes during the copy you could lock the data areas during the copy with ALCOBJ. You could put this in a separate CL program and write a Command front end to make your own single command to do the copy.
Paul
Principal Programmer Analyst
IS Supply Chain/Replenishment
508-253-3934
-----Original Message-----
Sent: Friday, October 01, 2010 8:36 AM
Subject: How to copy a data area (with one simple command)?
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
T***@public.gmane.org
2010-10-01 14:20:18 UTC
Permalink
He said "same object attributes" so in this case it's not an issue...

Thanks,
Tommy Holden



From: Vern Hamberg <vhamberg-***@public.gmane.org>
To: Midrange Systems Technical Discussion <midrange-l-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org>
Date: 10/01/2010 09:19 AM
Subject: Re: How to copy a data area (with one simple command)?
Sent by: midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org



What if he doesn't know the attributes of the source data area? More
of a challenge, eh?

Vern
Post by Richard Casey
Peter,
I think you'd have to do a RTVDTAARA/CHGDTAARA pair to copy the
contents. If you're worried about data area changes during the copy you
could lock the data areas during the copy with ALCOBJ. You could put this
in a separate CL program and write a Command front end to make your own
single command to do the copy.
Post by Richard Casey
Paul
Principal Programmer Analyst
IS Supply Chain/Replenishment
508-253-3934
-----Original Message-----
Sent: Friday, October 01, 2010 8:36 AM
Subject: How to copy a data area (with one simple command)?
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Vern Hamberg
2010-10-01 15:24:29 UTC
Permalink
Ah - I too forgot to read everything - so it's RTVDTAARA/CHGDTAARA in
a command that's his ticket. Or DLTDTAARA/CRTDUPOBJ.
Post by T***@public.gmane.org
He said "same object attributes" so in this case it's not an issue...
Thanks,
Tommy Holden
Date: 10/01/2010 09:19 AM
Subject: Re: How to copy a data area (with one simple command)?
What if he doesn't know the attributes of the source data area? More
of a challenge, eh?
Vern
Post by Richard Casey
Peter,
I think you'd have to do a RTVDTAARA/CHGDTAARA pair to copy the
contents. If you're worried about data area changes during the copy you
could lock the data areas during the copy with ALCOBJ. You could put this
in a separate CL program and write a Command front end to make your own
single command to do the copy.
Post by Richard Casey
Paul
Principal Programmer Analyst
IS Supply Chain/Replenishment
508-253-3934
-----Original Message-----
Sent: Friday, October 01, 2010 8:36 AM
Subject: How to copy a data area (with one simple command)?
Hi list!
I need to know if it is possible to copy the contents of an existing
data
Post by Richard Casey
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Mark S. Waterbury
2010-10-01 14:07:30 UTC
Permalink
Hi, Peter:

As the late, great Al Barsa liked to say, "There's a TAATOOL for that!"
-- see: http://taatool.com/document/L_cpydtaara.htm

Or, if you don't have TAATOOLS, you can easily write your own command
that calls a CL program that does a RTVDTAARA of the "from" data area,
and a CHGDTAARA to the "target" dta area.

Then, in fact, you can do it "... all in one single command." :-)

HTH,

Mark S. Waterbury
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Peter_Vidal-/
2010-10-01 14:28:15 UTC
Permalink
"As the late, great Al Barsa liked to say, "There's a TAATOOL for that!"
-- see: http://taatool.com/document/L_cpydtaara.htm"

Yeap... I whish we had this toolbox in our shop....


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Peter_Vidal-/
2010-10-01 14:53:52 UTC
Permalink
Looks like there is not too much of a clear / easy / cool option to take
here, so I decided to create a CLP:

PGM

DCL VAR(&DATE) TYPE(*DEC) LEN(7 0)
RTVDTAARA DTAARA(LIBRARY1/ABC123) RTNVAR(&DATE)
CHGDTAARA DTAARA(LIBRARY2/ABC123) VALUE(&DATE)

ENDPGM

A call to this program is now in place in our AS400 Scheduler to execute.

Thank you all for your tips, comments and insight on this subject and best
regards to all!


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Mark S. Waterbury
2010-10-01 15:23:35 UTC
Permalink
Hi, Peter:

I would suggest one small change, to make this "copy" operation entirely
"safe":

PGM
DCL VAR(&DATE) TYPE(*CHAR) LEN(7)
ALCOBJ OBJ((LIBRARY1/ABC123 *DTAARA *EXCL))
ALCOBJ OBJ((LIBRARY2/ABC123 *DTAARA *EXCL))
RTVDTAARA DTAARA(LIBRARY1/ABC123) RTNVAR(&DATE
CHGDTAARA DTAARA(LIBRARY2/ABC123) VALUE(&DATE)
DLCOBJ OBJ((LIBRARY1/ABC123 *DTAARA *EXCL))
DLCOBJ OBJ((LIBRARY2/ABC123 *DTAARA *EXCL))
ENDPGM

This ensures that this operation is "atomic" and that no other jobs can
alter either of the data areas during the "copy" operation.

HTH,

Mark S. Waterbury
Post by Peter_Vidal-/
Looks like there is not too much of a clear / easy / cool option to take
PGM
DCL VAR(&DATE) TYPE(*DEC) LEN(7 0)
RTVDTAARA DTAARA(LIBRARY1/ABC123) RTNVAR(&DATE)
CHGDTAARA DTAARA(LIBRARY2/ABC123) VALUE(&DATE)
ENDPGM
A call to this program is now in place in our AS400 Scheduler to execute.
Thank you all for your tips, comments and insight on this subject and best
regards to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Peter_Vidal-/
2010-10-01 15:43:35 UTC
Permalink
"I would suggest one small change, to make this "copy" operation entirely
"safe": ..."

===> ALCOBJ / DLCOBJ DTAARA's

".. This ensures that this operation is "atomic" and that no other jobs
can
alter either of the data areas during the "copy" operation."

Thank you Mark!


PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com

"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
--------------------------------------------------------------------------------

Attention:

This communication may contain information that is confidential,
privileged and/or exempt from disclosure under applicable law.
If you are not the intended recipient, please notify the sender
immediately and delete the original, all attachments, and all
copies of this communication.


--------------------------------------------------------------------------------
Vern Hamberg
2010-10-01 14:09:55 UTC
Permalink
Peter

Not without writing your own, that I know of. And you can't even
retrieve the attributes directly, like length and type. I thought I
might be able to use CPY - it is an MI-type space object - as I can with
a user space. That didn't work. However, I did a quick look at things
with DMPOBJ - seems I've been mentioning that a lot lately! In this
case, I see little chance that IBM will change the layout of the spooled
file. The information of interest is on the first page, in the SPACE-
section. Look at this bit from a 50-character data area -

SPACE-
000000 040032E6
000020 F0F14040
000040 40404040

The first byte x'04' means it is a character type. The next 2 bytes
x'0032' are the length (max 2000 at v5r3 and probably onward - haven't
checked). After that is the value, but you can get that with RTVDTAARA
better.

Here's the same thing for a 5,2 decimal type, value = 3.18.

SPACE-
000000 03020500 318F0000
000020 40404040 40404040

The x'03' indicates the type. Decimals follows (x'02') and then full
length (x'05'). Then the value - the blank is there in the spooled file
- again, this could be retrieved with RTVDTAARA, perhaps a bit more
challenging in CL.

A *LGL type has type byte x'84' - it's essentially a special case of a
char type.

*DDM type isn't a useful item in this picture - no way to get the
attributes from the other system, easily.

You could use the spooled file to get the value directly - might be
useful in the case of *DEC, in order not to have to deal with the
several scale and precision variants. That's the harder work. There are
C/C++ functions to deal with packed data, so they might help.

Do you want to write this? Wish I had the time.
Vern
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
T***@public.gmane.org
2010-10-01 14:19:18 UTC
Permalink
Oops my bad...missed the existing part...RTVDTAARA then CHGDTAARA in a CL

Thanks,
Tommy Holden



From: Vern Hamberg <vhamberg-***@public.gmane.org>
To: Midrange Systems Technical Discussion <midrange-l-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org>
Date: 10/01/2010 09:11 AM
Subject: Re: How to copy a data area (with one simple command)?
Sent by: midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org



Peter

Not without writing your own, that I know of. And you can't even
retrieve the attributes directly, like length and type. I thought I
might be able to use CPY - it is an MI-type space object - as I can with
a user space. That didn't work. However, I did a quick look at things
with DMPOBJ - seems I've been mentioning that a lot lately! In this
case, I see little chance that IBM will change the layout of the spooled
file. The information of interest is on the first page, in the SPACE-
section. Look at this bit from a 50-character data area -

SPACE-
000000 040032E6
000020 F0F14040
000040 40404040

The first byte x'04' means it is a character type. The next 2 bytes
x'0032' are the length (max 2000 at v5r3 and probably onward - haven't
checked). After that is the value, but you can get that with RTVDTAARA
better.

Here's the same thing for a 5,2 decimal type, value = 3.18.

SPACE-
000000 03020500 318F0000
000020 40404040 40404040

The x'03' indicates the type. Decimals follows (x'02') and then full
length (x'05'). Then the value - the blank is there in the spooled file
- again, this could be retrieved with RTVDTAARA, perhaps a bit more
challenging in CL.

A *LGL type has type byte x'84' - it's essentially a special case of a
char type.

*DDM type isn't a useful item in this picture - no way to get the
attributes from the other system, easily.

You could use the spooled file to get the value directly - might be
useful in the case of *DEC, in order not to have to deal with the
several scale and precision variants. That's the harder work. There are
C/C++ functions to deal with packed data, so they might help.

Do you want to write this? Wish I had the time.
Vern
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
T***@public.gmane.org
2010-10-01 14:18:19 UTC
Permalink
Why not just CRTDUPOBJ??? Seems MUCH simpler to me...

Thanks,
Tommy Holden


From: Vern Hamberg <vhamberg-***@public.gmane.org>
To: Midrange Systems Technical Discussion <midrange-l-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org>
Date: 10/01/2010 09:11 AM
Subject: Re: How to copy a data area (with one simple command)?
Sent by: midrange-l-bounces-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org



Peter

Not without writing your own, that I know of. And you can't even
retrieve the attributes directly, like length and type. I thought I
might be able to use CPY - it is an MI-type space object - as I can with
a user space. That didn't work. However, I did a quick look at things
with DMPOBJ - seems I've been mentioning that a lot lately! In this
case, I see little chance that IBM will change the layout of the spooled
file. The information of interest is on the first page, in the SPACE-
section. Look at this bit from a 50-character data area -

SPACE-
000000 040032E6
000020 F0F14040
000040 40404040

The first byte x'04' means it is a character type. The next 2 bytes
x'0032' are the length (max 2000 at v5r3 and probably onward - haven't
checked). After that is the value, but you can get that with RTVDTAARA
better.

Here's the same thing for a 5,2 decimal type, value = 3.18.

SPACE-
000000 03020500 318F0000
000020 40404040 40404040

The x'03' indicates the type. Decimals follows (x'02') and then full
length (x'05'). Then the value - the blank is there in the spooled file
- again, this could be retrieved with RTVDTAARA, perhaps a bit more
challenging in CL.

A *LGL type has type byte x'84' - it's essentially a special case of a
char type.

*DDM type isn't a useful item in this picture - no way to get the
attributes from the other system, easily.

You could use the spooled file to get the value directly - might be
useful in the case of *DEC, in order not to have to deal with the
several scale and precision variants. That's the harder work. There are
C/C++ functions to deal with packed data, so they might help.

Do you want to write this? Wish I had the time.
Vern
Post by Peter_Vidal-/
Hi list!
I need to know if it is possible to copy the contents of an existing data
area into another existing data area (same object attributes) and all in
one single command.
TIA and HAPPY FRIDAY to all!
PETER VIDAL
PALL CORPORATION
SR System Analyst | WH Application Development
10540 Ridge Rd., Suite 203, New Port Richey, FL 34654-5111
727-815-3104 | Fax: 727-815-3120 | www.pall.com
"Imagination is more important than knowledge"
Albert Einstein (1879 - 1955)
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request-Zwy7GipZuJhWk0Htik3J/***@public.gmane.org
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
Continue reading on narkive:
Loading...