PDA

View Full Version : Multiple line trap



Peter
August 11th, 2003, 12:29 PM
Can anyone help.
I am trying to trap multiple lines.
SMITHHH, JUDITH A REGULAR 18.55 1484 1136 20991.4
0105 0162 HOLIDAY
123-45-6789 SICK
VACTION

This is a payroll record. The file number is on the second line (0162). I need to get the file number, regular pay and any other earnings in a row. I have tried every combination I can think of. The best I can do was have the file number skip the first record and be off by one.
Thanks
Peter

Winn
August 11th, 2003, 01:38 PM
Peter,

A couple of questions:

1. Are you using a multiple line trap to cover the entire record?

2. Have you tried trapping the file number and setting the trap line to 2?

Doing these may help get you the results that you want.

Peter
August 11th, 2003, 02:18 PM
I tried both of these options. Trapping the hole record would not let me select all the wages, ie. vacations. Setting the second line also would not let me select all wages and would skip first record.

Peter

Winn
August 11th, 2003, 03:19 PM
OK, I think that I am beginning to understand your situation. I have one question. Your report looks something like this, correect?
SMITHHH, JUDITH A REGULAR 18.55 1484 1136 20991.4
0105 0162 HOLIDAY
123-45-6789 SICK
VACATION
the number of lines in each record is 3 or more. So you want each person to be in a single row with the earnings for each payroll item in a seperate field.

Does this sum up what you are looking for?

Peter
August 11th, 2003, 03:28 PM
Winn,
Yes that is correct. I want my first column to be my file Number. After that my regular earning, o/t and then other earnings in separate columns.

Peter

Grant Perkins
August 11th, 2003, 03:37 PM
Peter,

Is your problem mainly related to creating a successful trap?

Or is it more a difficulty in defining the fields reliably?

I have to observe that it looks quite simple at first sight (using a cut and paste copy of your posted data record as it appears when viewed thrugh the 'Post a Reply' screen) so I wonder if I am missing something problematic.

Are you in a position to release a sample file (confidential data changed if necessary) via email that I (or we if others are prepared to do it) can play with?

Grant

PS Looks like you had another exchange with Winn while I was preparing my response. I think my questions are still valid but Winn may well provide the solution for you without any need to respond to my questions.


Originally posted by Peter:
Can anyone help.
I am trying to trap multiple lines.
SMITHHH, JUDITH A REGULAR 18.55 1484 1136 20991.4
0105 0162 HOLIDAY
123-45-6789 SICK
VACTION

This is a payroll record. The file number is on the second line (0162). I need to get the file number, regular pay and any other earnings in a row. I have tried every combination I can think of. The best I can do was have the file number skip the first record and be off by one.
Thanks
Peter

[ August 11, 2003, 02:59 PM: Message edited by: Grant Perkins ]

Peter
August 11th, 2003, 03:43 PM
Grant,

Yes, I can send the you some of it. I have to change some of the info due to confidentiality.

Peter

Grant Perkins
August 11th, 2003, 04:05 PM
Peter,

That would be useful and I understand the need for confidentiality.

As I am going to be away until later in the week and I fully expect Winn to provide the answers you need by then, I would suggest you hold on for while before preparing a file (unless Winn would find it useful).

If you do decide you want to send something, post me a Private Message with your email address and I will let you have my email address so you can send the file.

Grant


Originally posted by Peter:
Grant,

Yes, I can send the you some of it. I have to change some of the info due to confidentiality.

Peter

[ August 11, 2003, 03:05 PM: Message edited by: Grant Perkins ]

Mike Urbonas
August 11th, 2003, 05:15 PM
Peter, you are in good hands with Winn and Grant but I will simply add that I have dealt with similar Payroll Registers. Each employee's detail data is different (ie, one line of data -40 hours regular - for Mary, two lines of data - 32 hours regular + 18 vaca for John, etc. etc.) This varying number of detail data lines per employee makes "one size fits all" multiple line traps impossible.

You will probably rnd up defining a trap just for the first 3 lines of each record, create fields to grab the name, file number, etc., and also use Advanced Field Properties to define a varying, multi-line field to capture the regular, sick, vaca etc. pay.

For example, when defining your fields in Report View, highlight the word REGULAR and double click on it to get to the Field Properties window. Click on Advanced tab and change the End Field Justification so the field will automatically include add'l data on the next line until there are no more records.

Go to the The Field Properties dialog in Monarch Help and read up on the Advanced Properties section. This will explain what I am trying to describe here. See also "Lesson 14 - Extracting Multiple Line Fields" in the Learning Guide.

Such an Advanced Field is the first key step in solving your report mining needs here.

Mike

Peter
August 11th, 2003, 05:26 PM
Mike,
I can get the data that I need. I need to have the File Number in each record. The problem is the File number is on the second line. It seems I can only get the File Number or the Payroll info, but not both.

Peter

Grant Perkins
August 11th, 2003, 07:32 PM
Peter,

I know where Mike is coming from and he offers a good solution as would be expected. But I reckon you should have no problem if you can get all the data you need.

If the record formats are ALL 4 rows (it is a little more complicated for variable rows but that is where Mike's solution comes in) then I can't see a problem with picking the file number from row 2. I ran up a quick template for all 4 rows as a single detail selection and can pick anything I want. The File Number field did not naturally appear as the first column in the table since the order of the columns is, by default, the order of the fields defined across row 1 then row 2 and so on. But it was picked and you can re-position the columns to the order you require.

If you don't always have all (4??) rows for each record that should make little difference to the result of picking the File Number data. However the method of selecting and identifying the fields related to REGULAR, SICK, HOLIDAY, VACATION (Holiday and Vacation are separate?) and so on may require some clever bits along the lines Mike described.

It may also be possible to make use of the Field Options > Start Field> Preceeding String feature. But your example post sort of suggests (unless I have misinterpreted) that you have a fairly consistent output (and you have also said you can get the data you want except the File Number field) so that is what I have been considering first.

Anyway, I will look forward to picking up on this when I get back, though I do suspect you will have your solution by then.

Best regards,

Grant


Originally posted by Peter:
Mike,
I can get the data that I need. I need to have the File Number in each record. The problem is the File number is on the second line. It seems I can only get the File Number or the Payroll info, but not both.

Peter

[ August 11, 2003, 06:33 PM: Message edited by: Grant Perkins ]

Peter
August 12th, 2003, 09:53 AM
Thanks for all your help. I'll give these suggestions a try.

Peter