× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.





Good morning everybody.
I am facing some trouble against command.run("WRKACTJOB") by jt open.

I get no messages from CommandCallExample.

The command I want to lunch is WRKACTJOB but I don't get via messages the real list of JOB running on system
but only errors messages. For example if I run an invented message GHGH i get the message:

CPD0030: Non trovato comando GHGH nella libreria *LIBL.
null
CPF0006: Si sono verificati errori nel comando.
null


Can anyone help me?
Thanks




import java.io.*;
import java.util.*;
import com.ibm.as400.access.*;


//javac -classpath .:/usr/lib/jt400.jar:/usr/lib/iText.jar CommandCallExample.java
//java -cp .:/usr/lib/jt400.jar:/usr/lib/iText.jar CommandCallExample

public class CommandCallExample
{
public static void main(String[] parmeters)
{

// Created a reader to get input from the user
BufferedReader inputStream = new BufferedReader(new InputStreamReader(System.in),1);



// Declare variables to hold the system name and the command to run
String systemString = null;
String commandString = null;

System.out.println( " " );



// Get the system name and the command to run from the user
try
{
//System.out.print("System name: ");
//systemString = inputStream.readLine();

System.out.print("Command: ");
commandString = inputStream.readLine();
}
catch (Exception e) {};

System.out.println( " " );



// Create an object. This is the system we send the command to
AS400 as400 = new AS400("192.168.0.29","user","fffffsdf");



// Create a command call object specifying the iSeries system that will
// receive the command.
CommandCall command = new CommandCall( as400 );



try
{
// Run the command.
if (command.run(commandString))
System.out.print( "Command successful" );
else
System.out.print( "Command failed" );



// If messages were produced from the command, print them
AS400Message[] messagelist = command.getMessageList();

if (messagelist.length > 0)
{
System.out.println( ", messages from the command:" );
System.out.println( " " );
}
else
{
System.out.println( " no messages" );
}
for (int i=0; i < messagelist.length; i++)
{
System.out.print ( messagelist[i].getID() );
System.out.print ( ": " );
System.out.println( messagelist[i].getText() );
System.out.println(messagelist[i].getHelp());
}
}
catch (Exception e)
{
System.out.println( "Command " + command.getCommand() + " did not run" );
}

System.exit(0);
}
}



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.