How do I view sortfile data while debugging?

 8 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
I am debugging a custom program that utilizes a very wide sort file.  Is there any way for me to see what is in that file while I'm debugging other than the little-tiny query variable display window in LID?  I need to be able to view/compare records within that file. Does anyone have any magic they can share?  Thanks! Kelly We're on DB2 AIX (Unix), if that matters.
Kelly Meade
J. R. Simplot Company
Boise, ID
John Henley
Send Private Message
Posts: 3351
Have you tried this: set a breakpoint after the sort but before the sorted file is opened, then from another process, copy the file and view it using a text editor?
Thanks for using the LawsonGuru.com forums!
John
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
Thanks John - that's exactly what I'd like to do.  My problem is, where do I copy the file from?  How do I find out where it lives?
Kelly Meade
J. R. Simplot Company
Boise, ID
John Henley
Send Private Message
Posts: 3351
Are you trying to see the *actual* sort file, or the results after the sort? Are you using PROCEDURE/OUTPUT PROCEDURE or SORT ... USING ... GIVING ?
Thanks for using the LawsonGuru.com forums!
John
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
I just want to see the records in the file - I don't care if it is before or after the sort.  The sortfile is defined in workdef. Here is how the sort is being done: SORT ZA307SRT-FILE       ASCENDING KEY  DSRT-BEN-EMPLOYEE      DESCENDING KEY DSRT-BEN-START-DATE       ASCENDING KEY  DSRT-BEN-PRE-SEQ-NBR                                    DSRT-BEN-AFT-SEQ-NBR                                    DSRT-BEN-CMP-SEQ-NBR      INPUT PROCEDURE 1000-SEL-REPORT      OUTPUT PROCEDURE 2000-DO-REPORT.
Here is a screenshot of the workdef for the sortfile.
Kelly Meade
J. R. Simplot Company
Boise, ID
John Henley
Send Private Message
Posts: 3351
The sort files are in the /tmp directory (or $TMPDIR if you have the variable set). If you can set a breakpoint, and check the temp directory you should be able to see the file by date created, etc. Another option, depending on how much time you have, is to change to use the SORT...USING / GIVING, which uses a separate work file, over which you have control for naming.
Thanks for using the LawsonGuru.com forums!
John
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
Hmmm.  I'm not finding anything in the tmp directory, and $TMPDIR isn't set.  I set a breakpoint at a place where the file should exist, but I'm not seeing it. Very strange. I resorted to doing a "display" statement and then cutting/pasting from the job log.  I guess that will work if I am limiting my data selection.  I may try your other suggestion too, if I can scrounge the time to convert it. Thanks for your help anyway! Kelly
Kelly Meade
J. R. Simplot Company
Boise, ID
Greg Moeller
Veteran Member Send Private Message
Posts: 1498
Veteran Member
Check your $LAWDIR/prodline/work directory... that seems to be where all of our tmp files get created.
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member
Hi Greg - I checked there too, and I'm not seeing the files there either, though that is where our other tmp files go.
Kelly Meade
J. R. Simplot Company
Boise, ID