ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • files

    Hi,


    How to read a file for a particular field value '1' and compare it's effective date field with today's date along with combination of reading the records of another file for a specific field value then write these records in to a third file.



    Thanks

  • #2
    Originally posted by John192 View Post
    Hi,


    How to read a file for a particular field value '1' and compare it's effective date field with today's date along with combination of reading the records of another file for a specific field value then write these records in to a third file.



    Thanks
    Note here the effective date field is in CYY/MM/DD format.


    Thanks...

    Comment


    • #3
      i tried to write below program:-


      **free

      dcl-f y1 disk usage(*input) keyed;
      dcl -s CvtDate Date;
      DOW Not %eof(y1);

      read y1;


      Cvtdate =%date(fld1: *CYMD);

      If CvtDate =%Date();


      ******************


      Further Program needs to read file1 (y1) for status code '1' and whose effective date is today's date(current date) along with reading the file2 (y2) for status code '0' whose specific value (some field name in file 2) is non zero then all these records needs to be sent in some new file3 (y3) .

      How can we club all these things altogether in a single RPGLE program ?




      Thanks...

      Comment


      • #4
        Any Updates by IBM i experts on this please?



        Thanks ...

        Comment


        • #5
          Basically I am willing to prepare equivalent RPGLE program for below SQL query:-

          Select * from File1 a left join file2 b on a.fld1 =b.fld3 where a.fld4 in ('1', '0' ) and b.fld5 <> 0


          where fld1 in file 1 and fld3 in file2 are of same data type and length and values of fld4 from file1 should be either '1' or '0' and value of field fld5 from file 2 should be non-zero.

          So How can we write equivalent RPGLE program for the same?



          Thanks...

          Comment

          Working...
          X