RPGIV: Moving Input record to Output

5 pts.
Tags:
AS/400
RPGIV
I am a beginner in AS/400. I have written one RPGIV program which requires to read one PF and will do some processing and will write into another Output file. Input Record format defined in input file : INPREC Output Record format defined in input file : OUTREC. Removing all the processing part , in the simple input output part , I am getting error for the record format definition. FINP1 IF E DISK FOUT1 O E DISK A C *IN99 DOUEQ'1' C READ INP1 99 C *IN99 IFEQ '0' C MOVELINPREC OUTREC C WRITEOUTREC C ENDIF C ENDDO * C SETON LR Error 1: QRG5194 Severity: 30 Number: 2 Message . . . . : The name specified previously is defined as file or Record-Format name. Error 2: QRG7030 Severity: 30 Number: 4 Message . . . . : The Field or indicator is not defined. Please help me understand Thanks

Software/Hardware used:
OS400

Answer Wiki

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

Are you in a classroom enviornment? If soo, you should be working with your instructor. If not, what training have our had?

The 2nd level text fully explains these errors.

QRG5194 – you are using a field anme that is the same as the name of a file or record format.

QRG9030 – You are using a field that is not defined anywhere in your program

 

Discuss This Question: 2  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
  • TomLiotta
    A record format name is not valid in a MOVE instruction, so the MOVE instruction assumed that you were defining two new fields with default or unknown attributes -- INPREC and OUTREC. But those names aren't valid because they are already used as format names. -- Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    Are your input and output files the same format ? Same number of fields and field names? If not, you need to move the individual fields to the output record before the write is done. Remember we read and write record formats. We move things like fields, arrays and data structures. A good rule of thumb is do not name your files record format the same name as your file. You can do it but you will need to rename your record format in the RPG program to avoid compiler errors.
    9,700 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