× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: update files
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Wed, 5 Jan 2000 10:24:47 -0800

Not to discourage you from trying your hand at RPG, but you can do it with
SQL very easily:

 update lib/file set DDSTAT='X' where DDSTAT='A' and DTYPE='JRNL'

If you do wish to write an RPG program, you can use READ as in

    C     *INLR      DOUEQ *ON
    C                READ  filename                    LR
    C     *INLR      IF    *OFF
    C     DDSTAT     ANDEQ 'A'
    C     DTYPE      ANDEQ 'JRNL'
    C                MOVE  'X'           DDSTAT
    C                UPDAT formatname
    C                ENDIF
    C                ENDDO

for ILE RPG:

    C                DOU   %eof(filename)
    C                READ  filename
    C                IF    not %eof(filename) and
    C                      DDSTAT='A' and DTYPE='JRNL'
    C                EVAL  DDSTAT='X'
    C                UPDATE formatname
    C                ENDIF
    C                ENDDO

HTH

Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax

----- Original Message -----
From: Art Baker <Art_Baker@baan.com>
To: <RPG400-L@midrange.com>
Sent: Wednesday, January 05, 2000 9:38 AM
Subject: FW: update files


> Hello,
> I looking to update a data file with RPG. Normally I've been using
> UPDDTA and changing the records, when required, but in this case there is
> over 900 records that needed to be updated. My question is which command
to
> use, SETLL, READE or CHAIN. There are two things to look for in this file,
> DTYPE
> and DDSTAT. The DTYPE to look for is JRNL and the DDSTAT to look for is
'A'.
> Both JRNL and 'A' need to be true then, change the 'A' to an 'X'.
> Thanks for any advice,
> Art
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
david@midrange.com
> +---


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.