tags:

views:

175

answers:

4

i want to write the output of a qshell command to local data area so that it could be globally used by programs.is there some way to write from stdout file to local data area .I want it to be done through CL..its urgent thanks

+1  A: 
QSH CMD('system chgdtaara dtaara\(qgpl/dataarea\) value\($(echo test)\)')
JamesA
thanks a lot but i dont know what name should be given to the data area ..i mean do i have to write *lda as i am trying to store the value in local data area or something else beacause when i am running this a error msg comes showing command not found ..please help me out ..
abhinav singh
To store the output in the *LDA just change the dtaara\(qgpl/dataarea\) parameter to dtaara\(*LDA\).I'm not sure why you would be receiving a command not found message. Can you post the exact message?
JamesA
A: 

The following command wrote ABC to my data area. (as a text value)

**system chgdtaara dtaara\(qsys/sequenceda\) value\($(echo abc)\)**

However, while trying to write the output of arsdate to a data area, I ran the following command: system chgdtaara dtaara\(qsys/sequenceda\) value\($('arsdate -a 01/01/10')\)

These were the errors received: qsh: 001-0014 Command arsdate -a 01/01/10 not found.
CPD0071: Parameter VALUE required.
CPF0001: Error found on CHGDTAARA command.
CPC2206: Ownership of object QZSHSYSTEM in QTEMP type *USRSPC changed.

Can you figure out a way to accomplish this?

abhinav singh
please anyone suggest something!!!!
abhinav singh
I believe you need to drop the single quotes around 'arsdate -a 01/01/10'.
JamesA
A: 

DATAREA -w /qsys.lib/testlibr.lib/dataartest.dtaara $(arsdate -a “05/21/10″)

This command copies the output of the qshell command arsdate into a data area dataartest in testlibr library. arsdate command returns the qshell date equivalent of an mm/dd/yy. Eg. 14751 is the qshell date equivalent of 05/21/10.

$

arsdate -a “05/21/10″ 05/21/10 -> 14751 $

actually i want to the output of this command to local data area (*lda) instead of copying it to dataartest…..please help me out

abhinav singh
the main problem is arising when i am entering this into local data area ....please anyone suggest
abhinav singh
A: 

I don't think you can update the *LDA from qshell ... as commands run through it, I think, are in a separate job.

You might want to consider using a named data queue ... you can use the dataq command from qshell.

It would probably be best to use a keyed data queue ... but I'm unsure how you would specify the key on the dataq command.

david