[Bulk] trying to change listing order on screen but am limited to what fields some of the files have

Ken Langendock ken.langendock at rogers.com
Thu Jan 19 16:07:28 CST 2012


Have you tried DETAIL file and ORDERBY statement on you CURSOR statement?

 

 

cursor studname where (syear of studname = 201112) &

   primary key lastname, firstname, student_num occurs 10

    access where (fields equal others) &

     via lastname, firstname, student_num

  (I've tried other accesses and select statements)    

Opens STGRADES grade file as designer

      Only student number is on this file not student name   

 

CURSOR studname DETAIL &

      OCCURS 10 &

      ORDERBY lastname, firstname, student_num

  ACCESS VIA syear USING 201112

 

 

Ken

 

 

From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com
[mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On
Behalf Of Helen Wellcome
Sent: January 19, 2012 4:29 PM
To: powerh-l at lists.sowder.com
Subject: [Bulk] trying to change listing order on screen but am limited to
what fields some of the files have

 

   Can anyone help me with listing my grade screen in student name order
instead of student number order?

 

Below are chopped up versions of current grade screen and below line-- what
I am trying to do to get in name order I can't add lastname field to
STSERVICE (that would be most logical, but can't)

 

EXISTING PROGRAM IN STUDENT NUMBER ORDER

 

Currently students get listed on the screen in student number order because
that is part of the key of STSERVICE

 

Receiving screen brings in STSECTION class section record data from previous
screen  

Opens STSECTION file as master

Opens STSERVICE students class file as primary using fields from STSECTION
and 

            Occurring 10 times on screen  

            The key consists of class data and student numbers of enrolled
students in that class, 

                    student name not on this file

Opens STGRADES grade file as designer

      Only student number is on this file not student name   

Open STUDENT data file as reference occurs with STSERVICE

       Has student number and student name

        

cluster occurs with stservice

display fields across and upto 10 per page

 

cluster

 

PROCEDURE FIND

  BEGIN

    FOR STSERVICE

      BEGIN

       GET STSERVICE VIAINDEX key data for the class in student number order


      END

    END

 

procedure postfind

  begin

    for stservice

      begin

        get student  viaindex using the student number optional

        if accessok

           then build lastname+firstname for display on screen

      end

  end

 

NEW PROGRAM WANTED IN STUDENT NAME ORDER

 

Want to get Students listed on the screen in student name order

 

Receiving screen brings in STSECTION class section record  

 

Sql declare studname cursor   gather some fields

  From STUDENT, STSERVICE, STSECTION

I've tried the WHERE statement here to just gather those students in one
class 

I've also tried not using STSECTION here and using select elsewhere for it

  order by lastname, firstname, student_num

 

Opens STSECTION file as master

Open STUDENT data file as reference  

          (I've tried with/without occurs with STUDNAME

       Has student number and student name

 

cursor studname where (syear of studname = 201112) &

   primary key lastname, firstname, student_num occurs 10

    access where (fields equal others) &

     via lastname, firstname, student_num

  (I've tried other accesses and select statements)    

Opens STGRADES grade file as designer

      Only student number is on this file not student name   

 

cluster occurs with studname

display fields across and upto 10 per page

 

cluster

 

PROCEDURE FIND

  BEGIN

       if not cursoropen(studname)

       then begin

          sql open studname

        end

 

    FOR STUDNAME

      BEGIN

          SQL FETCH STUDNAME

       END 

 

procedure postfind

  begin

    for studname

      begin

        get student  viaindex for the student number optional

        if accessok

           then build lastname+firstname for display on screen

      end

  end

 

 

        

 the closest output I was able to get was students in alpha order, with "not
on file" mixed in. But I had way more students than for that one class
listed.  I did a lot of juggling of sql, cursor, where, select.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sowder.com/pipermail/powerh-l/attachments/20120119/0799eb15/attachment.htm>


More information about the powerh-l mailing list