As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at email@example.com and provide your corporate email address, company, and name.
I've got a data file that contains records for students. Each record contains a student number, then can contain anywhere from one to several records of test results info for that same student. For example:
I've tried using LAST - type logic (If STU_ID EQ LAST STU_ID..... but don't get the results I want. I still get more than one line of output when a student has more than one record of test data. Hers is the code I am using:
SCORE1A /P4 = IF ((STU_ID EQ LAST STU_ID) AND (TEST_CODE EQ LAST TEST_CODE) AND (SCORE1 GT LAST SCORE1)) THEN SCORE1 ELSE LAST SCORE1;
Incidentally, I only want to use certain Tests... i.e., if TEST = XXX, then I want to ignore other tests, etc. and just to add to the fun, only to use the most recent dates when tests are identical.
I've got myself royally confused and would definitely appreciate anyone's assistance on something that is probably relatively simple. Thank you in advance, to all who reply.This message has been edited. Last edited by: webmeister,
My bad... There are other criteria in this project that stipulate if the student has a test AXX, then just ignore test AYY... the same applies to student 3, but for other types of tests. It's somewhat like if the student has taken a test in Biology or whatever, then ignore the test that the student took in Phys Ed. Hope that helps explian a little more. I Perhaps this will help a little more:
If a student has test AXX and Test AYY, ignore test AYY Within Test AXX, if the student has more than one test AXX, determine the most recent date of Test AXX If there are multiple Tests of AXX, pick the latest date and also the highest test scores of all of the AXX tests.
Is that any clearer of an explanation? If not, would you please let me know?
Thanks for your suggestion.... Not sure if that'll work, but I'll give it a try also. How is beautiful downtown Tel Aviv?
I'll copy your sample, stick my MVS/TSO JCL onto it and let you know as soon as I can.
But, and here's the stickler.... If there is not a test AXXX, then we have to include test AYY, and same thing for if there is not a test DEF then we have to use test ABC. It's this kind of crazy logic that is driving me nuts.
In the cases where a student has AXX and AYY, ignore AYY, but if a student only has AYY then use it. And of course, there are students who have test AXX, AYY, ABC and DEF so in those cases, we have to use AXX. It's going to be a fun mess, sorting through the multiple permutations!
Your max. will work unless the most current date is also needed. Sounds like a file with multiple tests and test types similar to the system I used to report on. Ended up doing selection for the max or most recent for a test type and then doing a merge on the information. Sorts by highest on the score wanted and then just including the date would get the information with a computed field based on last stu_id then do a where total test. Sorry I don't have access to post a code example any more. And I did get your private message as well.
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004
In our MVS/TSO environment, I got the following errors, trying to run your sample:
FOCUS 7.1.1 10.12.31 08/21/2008 PDSLIST LINE 2 9622.04
FI STUMAS DISK STUDENT.MAS 0UNKNOWN FOCUS COMMAND FI BYPASSING TO END OF COMMAND 0 ERROR AT OR NEAR LINE 4 IN PROCEDURE PDSLIST FOCEXEC 0(FOC340) DIALOGUE MANAGER -WRITE FILE NOT ALLOCATED OR FILEDEF'ED: -WRITE STUMAS FILENAME=STUDENT,SUFFIX=FIX
Interesting comments.... I'll digest them as much as possible.
If you already have the file to report on, you don't need anything that I posted except the table request. I had to create test data.
And it's APP FI not FI. And if you are running this from mainframe FOCUS then you will have to use DYNAM ALLOC instead of doing a filedef. Remember, we all run on different platforms.
And Leah is correct. You could start off by not having the WHERE clause and take a look at what you get. Then post-process that file to do exclusions.
WM, you are going to have to go beyond what we tell you and do some experimenting on your own. You already know how to do the basics. Just print out your hold files and take a look at the contents and then think about what else you could do to isolate your problems.
I worked in the Sinai Desert back in 1981, in charge of computer operations for the Camp David work going on there. I've seen Tel Aviv and Jerusalem and would love to go back.
And now, back to the students issues.... I've got the initial issues solved and am getting the hightest scores coming out nicely, but here is the next part:
Students can have one or more tests, and of those tests, some of the tests have higher priority than others.
So, her is what is ultimately wanted -
Student 1 ACT Test <====== only this type of test is wanted on the output ACCUP Test <====== discard this test, IF there is an ACT test present for the student
Student 2 SAT Test <===== only this type of test is wanted on the output
Student 3 ACT Test <====== only this type of test is wanted on the output SAT Test <====== discard this test, IF there is an ACT test present for the student
Student 4 ACCUP Test <====== this test is wanted, since there is no ACT or SAT test SISB1 Test <====== this test is also wanted SISB2 Test <====== this test is also wanted
In short, if there is an ACT test for a student, take only that test and no others. If there is an SAT test but no ACT test, take only that test and no others. If there is no ACT or SAT test, then take all of the other test types.
Any ideas on how to work that kind of crazy logic?
Thanks for your help yesterday, and Shabbat Shalom!