Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Maximize ROI with Qlik Professional Services – Expert Guidance, Faster Results: Explore Qlik Services
cancel
Showing results for 
Search instead for 
Did you mean: 
isma123i
Partner - Contributor II
Partner - Contributor II

How do I execute this command in Talend?

I need to execute this command:

 

QUOTE RCMD SBMJOB CMD(CALL PGM(EUROBJ97/J667508) PARM('parameter1' 'parameter2')) JOBQ(ECOREDD)

 

I am using a tSystem component, but I am not sure how do I have to authenticate to the AS400 machine. Could anyone help me?

Labels (1)
9 Replies
quentin-vigne
Partner - Creator II
Partner - Creator II

Hi @isma123i 

 

If you want to use tSystem you could set the Command as : 

ssh USER@AS400_HOST "QUOTE RCMD SBMJOB CMD(CALL PGM(EUROBJ97/J667508) PARM('parameter1' 'parameter2')) JOBQ(ECOREDD)"

 

Alternatively, you could also use tAS400Row to execute stored procedure without the need to go through system commands.

Let me know if you still need help

- Quentin

isma123i
Partner - Contributor II
Partner - Contributor II
Author

I have tried your solution, but I can not figure it out to make it work. I guess that you provided a ssh command, so I have to use tSSH component. However, when I put the command in there it does not work. Could you please me show a screenshot of the component filled with the command?

 

Thank you in advance

quentin-vigne
Partner - Creator II
Partner - Creator II

The solution I gave you was for a tSystem component. 

Inside it there is a section called "Command", type the command

quentinvigne_0-1742224227882.png

use "ssh USER@AS400_HOST" to connect to your AS400 server, replace USER and @AS400_HOST to your username and host. If your server doesn't allow SSH connection you will have to use tAS400 components 

isma123i
Partner - Contributor II
Partner - Contributor II
Author

Thanks again, but I still have the same error:

 

tSystem_2 Cannot run program "ssh": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: Cannot run program "ssh": CreateProcess error=2, The system cannot find the file specified

 

I am going to give a try to the tAS400row component, but as far as I know this component will ask me for a sql query instead of a command, right?

quentin-vigne
Partner - Creator II
Partner - Creator II

Maybe you need to add SSH to Path so that Talend know where to look for (since you have a new computer maybe it's not in Path). Press Win + R, type sysdm.cpl, and press Enter. Go to advanced and environment variables and edit Path to check if SSH is in your path. If not, add it and try again

quentinvigne_0-1742227809880.png

 

Also if the user doesnt have access you might want to use su username -c to use the correct user.

"su <<username>> -c 'ssh USER@AS400_HOST "QUOTE RCMD SBMJOB CMD(CALL PGM(EUROBJ97/J667508) PARM('parameter1' 'parameter2')) JOBQ(ECOREDD)'"

 

 

Alternatively yes you can use tSSH component if you don't want to type the ssh like this by setting up the tSSH component like this : 

quentinvigne_1-1742228790327.png

 

 

for tAS400Row, yes it's going to ask for a SQL Query, but if I remember well you can call SBMJOB from the query tab with the CALL QSYS function.

CALL QSYS.QCMDEXC('SBMJOB CMD(CALL PGM(EUROBJ97/J667508) PARM(''parameter1'' ''parameter2'')) JOBQ(ECOREDD)', 0000000100.00000)

 

You need to provide the length, I used this website to help me : https://www.rpgpgm.com/2017/02/why-i-should-be-using-qcmdexc-sql.html 

 

- Quentin

isma123i
Partner - Contributor II
Partner - Contributor II
Author

My ssh path exists, but it does not work anyways. I also tried the tAS400row, just like this:

 

9XazEbO - Imgur.png

But I get this error

 

Error
2025-03-18 11:44:13:584tDBRow_2 - [CPF0006] Errors occurred in command.

 

 

quentin-vigne
Partner - Creator II
Partner - Creator II

@isma123i Have you tried the tSSH component ?

 

Maybe try with QSYS2 alternative ? Please copy and paste the solution since we are using doubled single quotes and not double quotes.

"CALL QSYS2.QCMDEX('SBMJOB CMD(CALL PGM(EUROBJ94/J557408B) PARM(''P557408'',''EUR0001'')) JOBQ(ECOREDD)')"

 

isma123i
Partner - Contributor II
Partner - Contributor II
Author

Yes, I tried the tSSH component

Now I get this error when I run your last solution with QSYS2 alternative:

2025-03-18 15:59:22:242tDBRow_2 - [SQL0204] QCMDEX in QSYS2 type *N not found.

quentin-vigne
Partner - Creator II
Partner - Creator II

Do you know what IBM version you use ? If it's 7.1 or lower QSYS2 doesn't exist and we have to use QSYS (which need cmd lenght) can you try copy and pasting this ? I can't see a reason it won't work

"CALL QSYS.QCMDEXC('SBMJOB CMD(CALL PGM(EUROBJ94/J557408B) PARM(''P557408'',''EUR0001'')) JOBQ(ECOREDD)', 0000000088.00000)"

The second parameter is the number of characters, including spaces between the single quotes in the SBMJOB command, which in this case is 88. If you need to change something in your command, please recount the character or it will not work.

Note: The second parameter must contain exactly 15 digits: ten to the left of the decimal and five to the right. 

 

- Quentin