开发者

writing the output of qshell(qsh) command to local data area

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 开发者_如何学Pythonsome way to write from stdout file to local data area .I want it to be done through CL..its urgent thanks


QSH CMD('system chgdtaara dtaara\(qgpl/dataarea\) value\($(echo test)\)')


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.


use iSeries dtarea construct as:

wc -l /tmp/mlco02.txt | datarea -w /qsys.lib/qgpl.lib/robtest.dtaara      

the data area qgpl/robtest is previously created

In this case I needed line (record) count of IFS file, so CLp could get it and split big files down.


QSH CMD('A=`cat /tmp/mlco02.txt | wc -l`;exit $A')
RCVMSG     MSGTYPE( *LAST ) RMV( *NO ) MSGDTA( &MSGDTA ) + 
           MSGID( &MSGID )                                 
           IF ( &MSGID *EQ 'QSH0005' )  DO                 
              CHGVAR &EXITSTS %BIN( &MSGDTA 1 4 )          
ENDDO
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜