AS400 OVRDBF RNX1011 Undefined record type is found in file

1380 pts.
Tags:
AS/400
I am trying to build a utility to clear out old mod marks and notes in the first 5 positions of a source file.  QRPGLESRC.

OVRDBF     FILE(CLRMODP) TOFILE(&FMLIB/&FMSRCF) +              MBR(&FMMBR)                                                                            CALL       CLRMODR1                              

PF -CLRMODP

A                                      UNIQUE            A          R CLRMODR                                     A            SRCSEQ         6S 2       COLHDG('Sequence') A            SRCDAT         6S 0       COLHDG('Data1')   A            SRCDTA       102A         COLHDG('Data2')   A          K SRCSEQ                                     

FClrModP   UF   E           K DISK                         *======================================================== C     *Start        SetLL     ClrModP                     C                   DOU       %Eof                        C                   Read      ClrModP                     C                   If        not %eof                    C                   Eval      %subst(srcdta:1:5) = *blanks C                   Update    ClrModR                     C                   Endif                                 C                   EndDo                                 C                   Eval      *inLr = *on                

I get RNX1011 Undefined record type is found in file CLRMODP.

a record is read with a format unknown to the RPG program

A source physical file appears to not have a record format name.  I did not know this.  Is there a way to get around this?

Thanks, Nick

 



Software/Hardware used:
AS400 CLP RPGLE

Answer Wiki

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

<pre>
Try this
1. Create a source member with an SQL statement to update the file
2, Create a CL program to do an OVRDBF and RUNSQLSTM
3. Create a User defined PDM option to run the program
4. WRKMBRPDM &yourlib/&yoursrc
5. Enter your PDM option
6. F13
7. ENTER
===
Sql source statement
update qrpglesrc
set SRCDTA = ‘ ‘ || substr(srcdta,6,200)

+++
CL Source
PGM (&L &F &N)

DCL &L *CHAR 10
DCL &F *CHAR 10
DCL &N *CHAR 10

OVRDBF FILE(&F) TOFILE(&L/&F) MBR(&N) SECURE(*YES) +
OVRSCOPE(*JOB) SHARE(*YES)

RUNSQLSTM SRCFILE(CHARLIEB/QSQLSRC) SRCMBR(SETSRCSQ) +
COMMIT(*NC)

DLTOVR FILE(&F) LVL(*JOB)

ENDPGM

++++

PDM Option
Call SETSRC (&L &F &N)</pre>

Discuss This Question: 6  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
  • NickHutcheson1
    A                                      UNIQUE            
    A          R CLRMODR                                     
    A            SRCSEQ         6S 2       COLHDG('Sequence')
    A            SRCDAT         6S 0       COLHDG('Data1')   
    A            SRCDTA       102A         COLHDG('Data2')   
    A          K SRCSEQ                                      
    
    FClrModP   UF   E           K DISK                         
     *=========================================================
    C     *Start        SetLL     ClrModP                      
    C                   DOU       %Eof                         
    C                   Read      ClrModP                      
    C                   If        not %eof                     
    C                   Eval      %subst(srcdta:1:5) = *blanks 
    C                   Update    ClrModR                      
    C                   Endif                                  
    C                   EndDo                                  
    C                   Eval      *inLr = *on
    1,380 pointsBadges:
    report
  • TomLiotta
    How about:
    UPDATE mylib/mysrcf SET SRCDTA = '     ' concat substr(SRCDTA,6)
    Just OVRDBF to the member and run a SQL UPDATE. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Part of the problem is going to be that every source file might have a different record format name. You'll need a little more code if you really want to do this with CL/RPG. Source files aren't intended to be processed as database files, so they don't have to follow database rules. They can be processed as database files, mostly. Tom
    125,585 pointsBadges:
    report
  • Splat
    Keep in mind that some of the RPG/PRGLE source may have compile-time arrays. You'll want to avoid wiping that.
    6,815 pointsBadges:
    report
  • Splat
    RPG/RPGLE Fat fingers today.
    6,815 pointsBadges:
    report
  • NickHutcheson1
    [...] 3. NickHutcheson1 is trying to clear up some AS/400 clutter. [...]
    0 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