Thursday, April 26, 2007

Remove and Add JOBQ to a subsystem

On AS400/iSeries when you submit a job and specify a job queue, the job goes to the subsystem that contains that job queue. to remove or add JOBQ to a subsystem:

Remove:

RMVJOBQE SBSD(MRCUTILLIB/BSC) JOBQ(MRCAPPLLIB/MRCTCPSRV)

Add:

ADDJOBQE SBSD(MRCUTILLIB/BSC) JOBQ(MRCAPPLLIB/MRCTCPSRV)

Friday, April 20, 2007

Disable submit button after click

A simple way is to use an onclick handler on the submit button to either disable or hide the button:

onclick="this.disabled=true"
onclick="this.visibility='hidden'"
onclick="this.display='none'"

Example:

<input name="btn" value="ACCEPT" type="submit" onclick="this.disabled=true" >

Parse a string to Date and format a date to string

Parse a string to Date:

DateFormat parser = new SimpleDateFormat("dd-MMM-yy");
Date date = null;

try {
date = (Date) parser.parse("31-Jul-07");
System.out.println("date=" + date);//Tue Jul 31 00:00:00 CDT 2007
} catch (ParseException e) {
e.printStackTrace();
}


Format a date to string:

Format fmt = new SimpleDateFormat("yyyy-MM-dd");
String iso = fmt.format(date);
System.out.println("iso=" + iso);//2007-07-31

Wednesday, April 04, 2007

Test queries on AS400/iSeries using STRSQL

Step 1, run start debug command (STRDBG)

Step 2, run start sql command (STRSQL)

Step 3, query database in STRSQL session

Step 4, use system request option 3 to view job log for messages generated by SQL engine.