45 pts.
 Sort Date/Time in WRKJOBSCDE in AS/400
How to sort by Date/Time in WRKJOBSCDE.

Software/Hardware used:
ASKED: November 22, 2010  7:41 AM
UPDATED: November 24, 2010  4:20 AM

Answer Wiki:
Unless there is some API to do this, you would need to output(*PRINT) and then have a program copy the report to a disk file and manipulate the data in that file.
Last Wiki Answer Submitted:  November 22, 2010  4:56 pm  by  CharlieBrowne   32,945 pts.
All Answer Wiki Contributors:  CharlieBrowne   32,945 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I’m not aware of any sorting in WRKJOBSCDE other than the default by name. If sorting is needed, you might need to use the List Job Schedule Entries (QWCLSCDE) API to list the entries into a user space. You can then retrieve entries into whatever container you feel comfortable sorting or you can sort the space directly if you’re comfortable with that.

You’ll then need some form of display to view the items. If you only want to view the items and you retrieved the user space entries into a database file, you can probably get by with just a RUNQRY command.

You might consider a User Defined Table Function (UDTF) that does the whole job, calling the API and returning entries into a table format.

Tom

 108,330 pts.

 

This should do what you want: WRKJOBSCDE SEQ(*DATETIME)

I am not sure when this option became available. We are running V5R4.

 5,525 pts.

 

The SEQ(*DATETIME) is either the right answer or as close as it gets. Good catch.

Tom

 108,330 pts.