display all recrods that start with A

95 pts.
Tags:
I have a file field using which i need to filter the records to be displayed.In the screen i have a 2 byte field for this filtration Example: if i enter R* , it should load all records that start with 'R'.Can anyone please let me know the most feasible logic that works...Its a high priority requirement so please suggest me solutions at an earliest oppurtunity .Thank you

Software/Hardware used:
AS400 - OS400 - RPGLE

Answer Wiki

Thanks. We'll let you know when a new response is added.

I think, You should be talking about a subfile, which will have a <b>position to</b>, where you will need to enter the starting character(R*).
You can use the SETLL indicator to point the File to the required position. In this case, to point to the records, which will start with ‘R’. From there, you can use your normal Read Operations for displaying the records which will start with ‘R’.

If you didnt mean this exactly, Post back here, with your requirement.

Pradeep.

Discuss This Question: 5  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
  • Hamsu
    Yes i need to display this in a subfile , Please let me know the logic behind it ? do u mean i need to setll teh file with value as R? will it fetch the records starting with R?
    95 pointsBadges:
    report
  • TomLiotta
    ...to setll teh file with value as R? will it fetch the records starting with R? First, a value such as 'R*' would normally mean only records that started with 'R'. That's not quite the same as positioning to 'R' and reading records from that point on. Records after 'R' would also include records that started with 'S' and 'T' and all later records. But 'R*' would mean that you stop reading as soon as you reached the first record that was after any 'R' record. So, how do you really want your input field to work? If one user enters 'R*' and another user enters 'R ', do you want your program to handle those differently? Tom
    125,585 pointsBadges:
    report
  • Hamsu
    Hi Tom, as i told is a 2 byte field, user can either enter 'R*' or 'RV'. In case of 'RV' i will have corresponding field in the file to directly key with and load alll records that have key field FLTYPE value as 'RV'. In case of 'R*' it should load only records that start with 'R'(i.e all the records which has the FLTYPE = values that start with R,Like RV,RS,RP,RJ etc. ) Ideally my input field should filter the records based on the value given in the 2 byte screen field.
    95 pointsBadges:
    report
  • Hamsu
    At the same time it should exclude the next set of records that start with character other than 'R'.
    95 pointsBadges:
    report
  • philpl1jb
    If subst(fieldIn,2,1) = '*'; StrPos = subst(fieldIn,1,1); EndPos = subst(fieldIn,1,1) + 'Z';<-- endinb position is the first char + a high value else; //Case where fieldin is used for start and end StrPos = fieldin; EndPos = fieldin; endif; Setll StrPos MyFile; then you are ready to read records and load your subfile .. until Keyfld > EndPos; Phil
    51,365 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