Sure, here is the translation: “as400 acsbundle.jar IBM”

huangapple go评论72阅读模式
英文:

as400 acsbundle.jar IBM

问题

我正在使用AS400。对于这个工具我完全是新手。

当我启动IBM工具界面后,我可以点击一个链接,打开另一个窗口,允许我执行SQL脚本。

然后,我可以执行一个命令,然后是一个SQL查询。

第一个命令(根据我理解的内容)允许我过滤数据,而第二个命令是一个基本的SQL查询。

我想要能够在命令行中直接使用jar执行这两个命令

我尝试像下面这样做:

java -jar /Applications/IBMiAccess/acsbundle.jar /plugin=rmtcmd /cmd="call myLib/myProg '20200706 20200708 10047'" /system=my.ip.address

java -jar /Applications/IBMiAccess/acsbundle.jar /plugin=cldownload /system=my.ip.address /clientfile=/Users/MYUSERNAME/Downloads/test.xlsx /sql="SELECT * FROM MYDB.MYTABLE" /userid=MYUSERID

第一个命令表示:程序已经正确执行,但是当我尝试下载结果(使用第二个命令)时,结果与预期不符... 更糟糕的是,我甚至可以不带任何参数执行该程序,它也会显示程序已正常执行。
当我打开我的文件时,它只给我当前日期的数据 :/

因此,如果有人能够帮助我解决这个问题,我将非常感谢!非常感谢您!

英文:

I'm working on AS400. I'm completely new on this tool.

When I launch the IBM tool interface I can click on a link to launch an other window that allows me to execute SQL scripts.

Then I can to execute 1 command and then a SQL request.

The first command (according to what I understood) allows me to filter the data while the second command is a basic SQL request.

I want to be able to execute this 2 commands but in command line with the jar directly.

I tried to do as below :

java -jar /Applications/IBMiAccess/acsbundle.jar /plugin=rmtcmd /cmd="call myLib/myProg '20200706 20200708 10047'" /system=my.ip.address

java -jar /Applications/IBMiAccess/acsbundle.jar /plugin=cldownload /system=my.ip.address /clientfile=/Users/MYUSERNAME/Downloads/test.xlsx /sql="SELECT * FROM MYDB.MYTABLE" /userid=MYUSERID

The first command says : the program has been executed correctly but when I try to download the result (with the second command) it's not the one expected... Worse I can even execute the program without any param and it says the program is executed normally.
When I open my file it's only give me the data from the current day :/

So if anyone can help me with this that'll be greatly appreciated ! Thanks a lot Sure, here is the translation:
“as400 acsbundle.jar IBM”

答案1

得分: 0

这里理解起来会很有用 - 我假设该程序将筛选后的输出写入一个表,然后SQL语句再读取这个表?
我猜测你在自动化方面的问题可能是第二个请求在第一个请求完成之前就开始了,因为它们将在完全独立的进程中运行。
你可能最好编写(或请其他人编写)一个存储过程,以便从SQL中调用第一步的程序,这样你可以将整个过程作为一个SQL脚本一次性调用。

英文:

It would be useful to understand what is happening here - I assume the program writes your filtered output to a table, which the SQL statement then reads?
I would guess your problem with automation is that the second request is starting before the first one finishes, because they will be running in completely separate processes.
You would probably be better off writing (or asking someone else to write) a stored procedure to call the program in the first step from SQL, so that you could call the whole lot in one go as a SQL script.

答案2

得分: 0

我找到了2个解决方案:

第一个方案是使用rss插件...如果没有人能帮助你理解先前的库/程序究竟是做什么的,那么你可以像这样做:

for indexArray in "${!ips[@]}"
do
  nameFile="${workingFolder}${warehouse[$indexArray]}.csv"
  java -jar $pathIBM/acsbundle.jar /system="${ips[$indexArray]}" /plugin=logon /USERID=${USERNAME} /PASSWORD=${PASSWORD}
  java -jar $pathIBM/acsbundle.jar /system=${ips[$indexArray]} /plugin=rss /sql="CALL MY_LIB.MY_PROG(${date28DaysAgos}, ${todayDate},${store})" /autorun=1 &
  pid=$!
  sleep 30
  kill -9 $pid
  java -jar $pathIBM/acsbundle.jar /plugin=cldownload /system="${ips[$indexArray]}" /clientfile="${nameFile}" /sql="SELECT * FROM MYDB.MYTABLE" /userid=${USERNAME}
done

基本上,这个解决方案允许您使用rss插件。根据您的库的执行时间(CALL MYPROG.MYLIB),您应该在终止进程之前增加sleep时间。

下一个解决方案,当然更简洁,就是拥有一个好的SQL查询,您知道您需要什么,然后:

for indexArray in "${!ips[@]}"
do
    nameFile="${workingFolder}${warehouse[$indexArray]}.csv"
    java -jar $pathIBM/acsbundle.jar /system="${ips[$indexArray]}" /plugin=logon /USERID=${USERNAME} /PASSWORD=${PASSWORD}
    java -jar $pathIBM/acsbundle.jar /plugin=cldownload /system="${ips[$indexArray]}" /clientfile="${nameFile}" /sql="${sql}" /userid=${USERNAME}
done
英文:

I found 2 solutions :

The first one is using the plugin rss.. If nobody can help you understand what is the previous lib / prog exactly do then you can something like :

  for indexArray in "${!ips[@]}"
  do
    nameFile="${workingFolder}""${warehouse[$indexArray]}".csv
    java -jar $pathIBM/acsbundle.jar /system="${ips[$indexArray]}" /plugin=logon /USERID=${USERNAME} /PASSWORD=${PASSWORD}
    java -jar $pathIBM/acsbundle.jar /system=${ips[$indexArray]} /plugin=rss /sql="CALL MY_LIB.MY_PROG(${date28DaysAgos}, ${todayDate},${store})" /autorun=1 &
    pid=$!
    sleep 30
    kill -9 $pid
    java -jar $pathIBM/acsbundle.jar /plugin=cldownload /system="${ips[$indexArray]}" /clientfile="${nameFile}" /sql="SELECT * FROM MYDB.MYTABLE" /userid=${USERNAME}
  done

Basically, this solutions allows you to use the rss plugin. Depending of the time of execution of your lib (CALL MYPROG.MYLIB you should increase the sleep time before killing the process.

Next solution, cleaner of course, will be to have a nice SQL request where you know what you need and then :

for indexArray in "${!ips[@]}"
do
    nameFile="${workingFolder}""${warehouse[$indexArray]}".csv
    java -jar $pathIBM/acsbundle.jar /system="${ips[$indexArray]}" /plugin=logon /USERID=${USERNAME} /PASSWORD=${PASSWORD}
    java -jar $pathIBM/acsbundle.jar /plugin=cldownload /system="${ips[$indexArray]}" /clientfile="${nameFile}" /sql="${sql}" /userid=${USERNAME}
done

huangapple
  • 本文由 发表于 2020年7月27日 11:57:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/63108483.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定