You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Can On-Break Logic be used in writing csv files in SQR ?

5 replies [Last post]
sweety's picture
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 01/16/2009
Posts: 15

I am using onbreak at two levels.The output in pdf files is proper.but when i try to put in csv files using Write command, the data gets repeated .
And if i use write command in onbreak procedures , then in the output of csv files ,the rows gets shifted .this shifting of the rows depend on data at which onbreak happens.

i am attatching the output of the csv file.

Suggest on this..

AttachmentSize
Sample.xls14.5 KB
Lepa's picture
User offline. Last seen 3 weeks 20 hours ago. Offline
Joined: 06/23/2008
Posts: 565
Re: Can On-Break Logic be used in writing csv files in SQR ?

Of course you can but i'm not sure why your file is acting up. I have done it before using the following on the field i'm breaking on.

(0,0) On-Break Print=Never Before=procedure-to-call-before-break After=procedure-call-after-break

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

sweety's picture
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 01/16/2009
Posts: 15
Re: Can On-Break Logic be used in writing csv files in SQR ?

Yes i have tried and used at level 2 onbreak.its working.
The rows were getting shifted because i was using separate write statements at different onbreak procedures,
and same time closing the file.
but when i used only one write statement,and closed the file after the execution of all the procedures,i got the required output.

Guest's picture
Guest (not verified)
Re: Can On-Break Logic be used in writing csv files in SQR ?

can any one tell how to use on-break with before and after procedure
in print line for saparated file

syntax is

print $field (0,100) on-break level=1 before=open-file after =end-file

when i run program with this syntax it shows "on-break with before and after can be used with in select"

but my situation is not possible in above condition means i am printing the field value in out side of select but i want be saparated file so

please let me know

Guest's picture
Guest (not verified)
Re: Can On-Break Logic be used in writing csv files in SQR ?

I have done this successfully.... Use this syntax

BEGIN-SELECT
Column1
Column2 () ON-BREAK level=1 PRINT=NEVER BEFORE/AFTER=
Column2 () ON-BREAK level=2 PRINT=NEVER BEFORE/AFTER=
...
....

and so on
let me know if it works

Guest's picture
Guest (not verified)
Re: Can On-Break Logic be used in writing csv files in SQR ?

Hi, if we use print command in sqr, will it cause any problems in csv file generated.For me,commas are missing for certain rows when i open csv, but pdf is working fine.I use on-break along with print command

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.