Execution preferences for select and ommit in logical files

240 pts.
Tags:
AS/400
C Language
Logical File
For select and omit conditions in logical file, is there any preferences will be applied while in execution, like ++,-- in C language?
ASKED: June 25, 2013  2:39 PM
UPDATED: June 25, 2013  2:46 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne
    When you CRTLF you are creating a file that only has pointers to data in a PF. If you use DDS to create the LF, your 'S" and/or 'O' statements use Boolean logic to determine which records are included in the file. You can also create a specific access path use 'K' statements.
    39,780 pointsBadges:
    report
  • TomLiotta
    I don't understand the question. In general, SELECT and OMIT rules for LFs shouldn't matter nowadays because you shouldn't be creating any LFs with SELECT and OMIT specifications. That is, it shouldn't be done at all. There are more modern ways that work better. . However, you might be looking at an old file and be trying to figure out what it does. If so, show it to us and we'll describe what's happening. . There is very little relationship between SELECT and OMIT specs and C ++ and -- operators. There is almost no point in trying to compare them. . Tom
    125,585 pointsBadges:
    report
  • sivakesava
    R RECORD CROLLNO CNAME CLASS K CROLLNO S CROLLNO ComP(crollno *Ge 20) O Cname comp(cname *eq 'KOHLI') Above is the logical file structure.Here data is like below, CNAME CROLLNO AJAY BABU 23 SRINIVAS 9 TUMMALA 30 AJAY 3 KOHLI 25 Here based on above, expected output will be two records with crollno as 30 and 23, but iam getting all the above records as output.
    240 pointsBadges:
    report
  • philpl1jb
    ok .. try this: O Cname comp(cname *eq ‘KOHLI’) S CROLLNO ComP(crollno *Ge 20) The system processes these requests sequentially 1. Omit any rows with cname = 'KOHLI' then 2. Select any rows with CROLLNO > 20 then 3. Omit any remaining records ( the opposite logic (s vs o) of the last request)
    48,545 pointsBadges:
    report
  • philpl1jb
    Logical files which can only be used for a few processes are a load on the system with very little payback. Programmers love these because they simplify the programming but data admin hates them because they waste resources.
    48,545 pointsBadges:
    report
  • TomLiotta
    What you apparently want is 'S'elect-'O'mit specifications that look like this:
    A          S CROLLNO                   COMP(GE 20)
    A            CNAME                     COMP(NE 'KOHLI')
    Note that the second line has neither 'S' nor 'O' specified. By leaving the character out, it becomes an AND condition. And because it's an AND, it is also a 'S'. Therefore, the COMP() condition was reversed from EQ to NE.
    .
    A list of specifications that all have 'S' or 'O' one after the other are OR specifications. So your example says to include all records that have CROLLNO greater or equal to 20 OR all rows that have CNAME not equal 'KOHLI'.
    .
    This provides a good example of why 'S'elect-'O'mit LFs should not be created at all today. Use a more modern method.
    .
    Tom
    125,585 pointsBadges:
    report
  • sivakesava
    we already tried the below code O Cname comp(cname *eq ‘KOHLI’) S CROLLNO ComP(crollno *Ge 20) our main concern is it is working fine when teh omit condition followed by select i.e. OMIT or SELECT condition is fine. but it is not working when we are trying select or omit condition. i.e. select followed by omit conditions. please clarify why system is behaving differently in the above mentioned cases.
    240 pointsBadges:
    report
  • philpl1jb
    When processing selects and omits the system assumes that there is one more statement. That assumed statement selects or omits all remaining rows. The logic for the assumed statement is that it will be opposite to the actual last .. so this S CROLLNO ComP(crollno *Ge 20) O Cname comp(cname *eq ‘KOHLI’) which ends with an omit then adds the effective statement S all others while reversing it O Cname comp(cname *eq ‘KOHLI’) S CROLLNO ComP(crollno *Ge 20) which ends in a select adds the logic for an omit Omit all remaining rows. and Tom's S CROLLNO COMP(GE 20) CNAME COMP(NE 'KOHLI') which means Select CROLLNO > 20 and CNAME 'KOHLI' would then create the ending logic to omit all remaining records
    48,545 pointsBadges:
    report
  • philpl1jb
    The logic works something like this for each row - if the first rule applies that row is selected/omitted - if the first rule doesn't apply and the second rule does then that row is selected/omitted - this logic continues until all rules are applied - for any remaining rows, if the last rule was submit then omit the remaining rows if the last rule was omit then submit the remaining rows
    48,545 pointsBadges:
    report
  • philpl1jb
    That being said, there has to be a compelling reason to build a logical file that is so specific.
    48,545 pointsBadges:
    report
  • TomLiotta
    please clarify why system is behaving differently in the above mentioned cases.
    .
    There's maybe the trickiest part of it. It happens because you didn't have a full set of 'S'elect-'O'mit specs. You left a line out.
    .
    You should read the rules for 'S'elect-'O'mit  ALL and what happens if you don't specify it. The default depends on whether you specify a 'S'elect or an 'O'mit as your last rule.
    .
    Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following