CPF5152

0 pts.
Tags:
Application development
CLP
DB2 Universal Database
RPG
Hello, I am experiencing a strange problem that is driving me crazy. First what I am attempting to accomplish is to read a DSPF file looking for specific output records and then write to a source file lines of RPG III code to output to those fields. What is happening is that after the 44th line of output my program ends stating that the 'format' is not found in my member. Note The data in the output does not seem to matter the program always aborts at the 44th line of output. My CL that overrides the output file is defined as such; OVRDBF FILE(OUTRRX) TOFILE(QTEMP/QRRXSRC) MBR(&MBR) + FRCRATIO(*NONE) LVLCHK(*NO) Thank you
ASKED: August 17, 2006  10:34 AM
UPDATED: August 18, 2006  1:53 PM

Answer Wiki

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

Not much code to draw any conclusions on, but let’s give it a whirl.

I assume you have an RPG program that has an F-spec with file OUTRRX as an output file. Is this described as an externally defined file and is that file a source physical file? When a source file is created it is given the same record format name as the file name so this file would have a format name of OUTRRX. So if you are creating a source file named QRRXSRC in QTEMP prior to overridng, you are trying to override format OUTRRX with a file that has a format name of QRRXSRC which could be giving you the format error. Instead of using CRTSRCPF to create the QRRXSRC file in QTEMP, do a CRTDUPOBJ of OUTRRX and name the new QTEMP file QRRXSRC. This way both files will have the same record format name.

Hope this helps.

Discuss This Question: 4  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
  • astradyne
    Hi It'd be helpful if you were able to post the source for the program you're running and the first 45 lines of the DSPF you're running over to see if it sheds any light. My gut is telling me it's something to do with the FRCRATIO(*NONE) parameter on the override and the source file record format not being renamed in the program. FRCRATION(*NONE) tells the system to determine when to write the records to the external storage, and if it's always falling over at the 44th output record regardless of which DSPF you run it over then I'd look there. Try removing the FRCRATIO parameter altoghether and see if it makes any difference, or for testings sake change it to 1 and see if you get the CPF message on the first write. I'm guessing that the record format of the source file your program was compiled with is different to the record format of the overriden source file and that the program hasn't renamed it. If it's neither of those please post some more code and we'll see what we can do. All the best Jonathan www.astradyne-uk.com
    370 pointsBadges:
    report
  • Joven1
    RPG Source FJDERRX IF E DISK UC F JDESRC KRENAMEJDERRXR FOUTRRX O E DISK A F OUTRRX KRENAMEOUTR E @C 1 7 80 E @D 1 1 1 IJDERRXR I SRCDT1 INPREC C MOVE *OFF *IN99 C OPEN JDERRX C *IN99 DOWEQ*OFF C READ JDERRXR 99 C *IN99 IFEQ *OFF C MOVELINPREC RRXIN P C RRFLDN IFEQ 'DETAIL' C RRFLDN OREQ 'TOTAL ' C MOVE *ON *IN51 C ENDIF C RRFLDN IFEQ 'HEADIN' C MOVE *OFF *IN51 C ENDIF C *IN51 IFEQ *ON C RRXID IFEQ 'RR' C RRXID OREQ '$$' C EXSR FILL1 C ENDIF C ENDIF C ENDIF C ENDDO C CLOSEJDERRX C FILL1 BEGSR C* Line 1 C MOVE *BLANKS SRCDTA C MOVEL@C,01 SRCDTA C WRITEOUTR C* C* Line 2 C MOVE *BLANKS SRCDTA C MOVELRRDTAI FRDTAI C FRDTAI CHAINI9203 81 C *IN81 IFEQ *OFF C @C,02 CAT FRDSCA:1 SRCDTA C ELSE C MOVEL@C,02 SRCDTA C ENDIF C WRITEOUTR C* C* Line 3 C MOVE *BLANKS SRCDTA C MOVEL@C,01 SRCDTA C WRITEOUTR C* C ENDSR
    0 pointsBadges:
    report
  • Joven1
    Thank you both for your suggestions. 1. Changing the CRTSRCPF to a CRTDUPOBJ command does not work still getting the same error. Changing the FRCRATION command on the OVRDBF command causes the Writes to fall at what ever line I set the FRCRATION to. This leads me to believe that the write is failing when forced to output to the database?
    0 pointsBadges:
    report
  • astradyne
    Hi I've been testing using a little routine based on yours, and get the same result as yourself. The only way I can get it to work is to create a source physical file with the same name as the one the program was compiled over and then rename it if I want it different. Thinking about it this seems to make sense in that a programmer would have control of the file that he creates and generates, so the system would expect to check record format names. For input files, on the other hand, there is less control over the file you're overriding to so the system allows the format to be different. After all, the program can format the record layout using data structures, etc. I would ask the question why you need to override the output file name? Would it be easier to keep it the same as the compiled over output file and avoid the error altogether?
    370 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