[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Loops



Hi all,
Chi's solution seems what worked best here.
Thanks so much!
Lisbett

                -----Original Message-----
                From:   Chi F. May [mailto:cfmay@CAPITOL-COLLEGE.EDU]
                Sent:   Thursday, March 15, 2001 4:32 PM
                To:     SQR-USERS@list.iex.net
                Subject:        Re: Loops

                Lisbett:
                You could try the following:
                !===================================
                 let #j=0
                 let $course_info_str = '';
                    while #j < 9
                      get $course_info from course(#j)
                      let $course_info_str =
$course_info_str||$course_info||$comma
                      add 1 to #j
                    end-while

                    write 2 from $course_info_str

                !====================================
                Chi




                > Hello everyone,
                >
                > I am using SQR version 6.1.3 for our IBM using AIX version
4.
                >
                > I am creating an SQR that picks up a students class
information.  This
                > student may have more than one class and up to max of 8
classes.  I am
                > outputting to a comma delimited file and I would like each
class information
                > to be put in its own column. I am using an array to put
each class data in
                > its own array row.
                >
                > My question:
                > To write to the comma delimited file, I am use a while
loop like the
                > following:
                >     $comma
                >                 &inst_lgpa
                >                 $comma
                > let #j=0
                >    while #j < 9
                >      get $course_info from course(#j)
                > write 2 from
                >                    $course_info
                >                $comma
                >      add 1 to #j
                >    end-while
                > end-procedure ! write_PL
                >
                > Now my problem is that when I use the write command all
over again (I
                > already had written a write command for this file) it
gives me a new line
                > for each class so the output looks like this:
                >
                > <all in one line>3333333333,Nowlin,Judith,N,PR,23
Waterbury Dr. Apt.
                >
202,,,Woodridge,IL,60517,6709884351,F,1,HIST,AS,AP,00,4,3.6,
                > <newline>  199902 HIST 405   3.00 F ,
                > <newline>  200002 ENG  496   3.00 C ,
                > <newline>  200101 ENG  301   3.00 D ,
                > <newline>  200101 PSYC 391   3.00 F ,
                >
                >
                > Is there a way to prevent that from printing the new line?
                >
                > Thanks in advance,
                > Lisbett