Subject: | |
From: | |
Reply To: | Dr. Ferenc Nagy |
Date: | Tue, 10 Jan 1995 09:13:15 +0100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On Mon, 9 Jan 1995 Clint Schwartz wrote:
> I need to be able to sort the SHOWJOB output to sort by job number. I'm
> redirecting the output to a file and then using SORT to sort the file with the
> job number as the key. The only problem is that the job number output from
> SHOWJOB is LEFT justified instead of RIGHT justified and blank or zero
> filled. This causes a problem when I use SORT because it uses the first
> character that it comes across in the key field to sort the file. As an
> example; #J555 wil come before #J61 and after #J1000.
>
Do you know the SORT-MERGE intrinsics? They are described with example
programs in the Pascal reference manual, Appendix H ,too.
Write a main program which calls the SORTINIT intrinsic, your
READ_UNSORTED and WRITE_SORTED procedure than the SORTEND intrinsic as in
the example in the manual shown.
Write a READ_UNSORTED procedure according to the sample program there,
which reads the output of the SHOWJOB command into a string named "line".
Read the job number by a "StrRead(line,3,y,jobnum)" statement from the
string into an integer variable and passes a record which contains this
integer and the other necessary parts of the line to the SORTINPUT
intrinsic.
Write a WRITE_SORTED procedure, which calls the SORTOUTPUT, then displays
the record in the required format.
Frank
************************Family : NAGY
*NNN......NN..FFFFFFFFF*First name : FERENC
*NNNN.....NN..FFFFFFFFF*Title : Ph. D., Scientific Co-Worker
*NN.NN....NN..FF.......*Company : Institute of Isotopes of
*NN..NN...NN..FF.......* the Hungarian Academy of Sciences
*NN...NN..NN..FFFFFF...*E-mail : [log in to unmask]
*NN...NN..NN..FFFFFF...* : [log in to unmask]
*NN....NN.NN..FF.......*P.O.B. addr.: 1525 BUDAPEST Pf. 77., HUNGARY
*NN....NN.NN..FF.......*Street addr.: 1121 BUDAPEST Konkoly-Thege M. ut 29.
*NN.....NNNN..FF.......*Fax : (36)-1-156-5045 or try (36)-1-169-5087
*NN......NNN..FF.......*Phone : (36)-1-275-4351 <=== NEW!
*NN......NNN..FF.......*Home address: 1214 BUDAPEST Raketa u. 29. I. 3., HUNGARY
************************Home phone : (36)-1-277-4229
"There are three kinds of programming errors: syntactical, semantical and
mystical."
"The programmers have to suck up the users just as much as absolutely
necessary."
|
|
|