i got the answer for write record in physical file member
i shared that concept coding....
Femp1 uf a e k disk usropn extmbr(a3) -- emp1 -> pf name
Da3 s 10a
C eval a3='EMP12' -- emp12 -> pf member name
C open emp1
C write employee -- employee - pf record format name
C close emp1
C eval *inlr=*on
Thanks, Mr.Pradeep, Mr. Phil and Mr. Tom.......
Last Wiki Answer Submitted: December 22, 2011 1:38 pm by pdsathishkumar3,740 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You can use EXTMBR Keyword in F – Spec while defining the file.
FSAMPLEPF UF A E K DISK EXTMBR(MBR1)
The EXTMBR keyword specifies which member of the file is opened. You can specify a member name, ‘*ALL’, or ‘*FIRST’. Note that ‘*ALL’ and ‘*FIRST’ must be specified in quotes, since they are member “names”, not RPG special words. The value can be a literal or a variable. The default is ‘*FIRST’.
The name must be in the correct case. For example, if you specify EXTMBR(mbrname) and variable mbrname has the value ‘mbr1′, the member will not be found. Instead, it should have the value ‘MBR1′.
i tried, but i didn’t get the solution… i share my program with you… if you find the solution, share with me………
Femp1 uf a e k disk extmbr(a3) — emp1-> pf name
Da3 s 10a
C eval a3=’EMP11′ — emp11 -> pf member name
C movel 120 empno — empno -> field name
C movel ‘sathish’ empname — empname -> field name
C write emp11
C eval *inlr=*on
i got error — *RNF7030 30 1 The name or indicator is not defined.
Arrrr yesss. It’s the only user open trick.
Your pogram trys to open the file prior to running any c-specs
Therefore it is trying to open the member with a blank value for a3
Changes
1. add keyword USROPN to F-spec
2. add C-spec OPEN EMP1 after the c-spec C:
—- eval a3=’EMP11′ — emp11 -> pf member name
3. add C-spec CLOSE EMP1 before evel *INLR = *ON <– this isn’t necessary in this case.
Mr. Phil, i tried your tips… but i didn’t get solution…. i got error..
Froughdsp cf e workstn — display file
Femp1 uf a e k disk usropn extmbr(a3) — emp1 -> pf name
Da3 s 10a
C open emp1
C eval a3=’EMP11′ — emp11 -> pf member name
C exfmt mbrw
C write emp1
C close emp1
C eval *inlr=*on
My error — *RNF5063 30 1 Factor 2 operand must not be an externally described file for this operation.
First, move your OPEN statement after you set the member name in a3. You can’t open the file until you set the member name.
Then, use the record format name in your WRITE statement. You are using the file name. You tagged this with V5R3, but it’s not totally clear what release you are compiling for. To be certain, use the record format name. I don’t see anything else that might cause the RNF5063 error.
Froughdsp cf e workstn — display file
Femp1 uf a e k disk usropn extmbr(a3) — emp1 -> pf name
Da3 s 10a
C eval a3=’EMP11′ — emp11 -> pf member name
C open emp1
C exfmt mbrw
C write emp1
C close emp1
C eval *inlr=*on
my error — *RNF5063 30 26 000502 Factor 2 operand must not be an externally described file for this operation.
I guess, The error showing here is not because of the Member selection.
But, Because of the Factor2(File Name) given on WRITE Opcode.
For WRITE & UPDATE Operations you will need to mention the Record format name of the Physical file.
Verify whether you have the same(EMP1) or Different Name.
These were all compile time errors.
The compiled listing gives the error number – which you reported to use but if you search the code for that number it will either show you the line in error or give you the line number in error. Use that to investigate your code.
Your first error
*RNF7030 30 1 The name or indicator is not defined
must have occurred because either EMPNO or EMPNAME wasn’t defined in your file.
Your second error
*RNF5063 30 1 Factor 2 operand must not be an externally
could be one of two lines your listing will tell you specifically which.
C exfmt mbrw <– this must be a record name in the file roughdsp
C write emp1 <- this must be the record format name not the file name
If you type DSPFD EMP1 you will see a description of the file emp1 including the record format name.
Phil
There is no error that refers to duplicate definitions, so we’re pretty sure that the record format name is not EMP1. (The error might not be shown, but I don’t think that we’d see a RNF5063 if the file and format had the same name.)
Phil’s suggestion for using DSPFD will show you the record format name. Your compile listing should also show that record format name for the EMP1 file.
The error is telling you that you can’t use the file name. We can be pretty sure that the error doesn’t apply to the EXFMT because the file name isn’t used there. It almost has to be the WRITE statement.
So don’t use the file name on the WRITE statement. Change the statement. Use the record name.
You can use EXTMBR Keyword in F – Spec while defining the file.
The EXTMBR keyword specifies which member of the file is opened. You can specify a member name, ‘*ALL’, or ‘*FIRST’. Note that ‘*ALL’ and ‘*FIRST’ must be specified in quotes, since they are member “names”, not RPG special words. The value can be a literal or a variable. The default is ‘*FIRST’.
The name must be in the correct case. For example, if you specify EXTMBR(mbrname) and variable mbrname has the value ‘mbr1′, the member will not be found. Instead, it should have the value ‘MBR1′.
Pradeep.
Write Operation on a File will remain as usual(using WRITE Opcode).
Records will be added to Selected Member using EXTMBR keyword.
Pradeep.
i tried, but i didn’t get the solution… i share my program with you… if you find the solution, share with me………
Femp1 uf a e k disk extmbr(a3) — emp1-> pf name
Da3 s 10a
C eval a3=’EMP11′ — emp11 -> pf member name
C movel 120 empno — empno -> field name
C movel ‘sathish’ empname — empname -> field name
C write emp11
C eval *inlr=*on
i got error — *RNF7030 30 1 The name or indicator is not defined.
Arrrr yesss. It’s the only user open trick.
Your pogram trys to open the file prior to running any c-specs
Therefore it is trying to open the member with a blank value for a3
Changes
1. add keyword USROPN to F-spec
2. add C-spec OPEN EMP1 after the c-spec C:
—- eval a3=’EMP11′ — emp11 -> pf member name
3. add C-spec CLOSE EMP1 before evel *INLR = *ON <– this isn’t necessary in this case.
Phil
Mr. Phil, i tried your tips… but i didn’t get solution…. i got error..
Froughdsp cf e workstn — display file
Femp1 uf a e k disk usropn extmbr(a3) — emp1 -> pf name
Da3 s 10a
C open emp1
C eval a3=’EMP11′ — emp11 -> pf member name
C exfmt mbrw
C write emp1
C close emp1
C eval *inlr=*on
My error — *RNF5063 30 1 Factor 2 operand must not be an externally described file for this operation.
First, move your OPEN statement after you set the member name in a3. You can’t open the file until you set the member name.
Then, use the record format name in your WRITE statement. You are using the file name. You tagged this with V5R3, but it’s not totally clear what release you are compiling for. To be certain, use the record format name. I don’t see anything else that might cause the RNF5063 error.
Tom
Mr. Tom, i do it… but i got same error
Froughdsp cf e workstn — display file
Femp1 uf a e k disk usropn extmbr(a3) — emp1 -> pf name
Da3 s 10a
C eval a3=’EMP11′ — emp11 -> pf member name
C open emp1
C exfmt mbrw
C write emp1
C close emp1
C eval *inlr=*on
my error — *RNF5063 30 26 000502 Factor 2 operand must not be an externally described file for this operation.
I guess, The error showing here is not because of the Member selection.
But, Because of the Factor2(File Name) given on WRITE Opcode.
For WRITE & UPDATE Operations you will need to mention the Record format name of the Physical file.
Verify whether you have the same(EMP1) or Different Name.
Pradeep.
These were all compile time errors.
The compiled listing gives the error number – which you reported to use but if you search the code for that number it will either show you the line in error or give you the line number in error. Use that to investigate your code.
Your first error
*RNF7030 30 1 The name or indicator is not defined
must have occurred because either EMPNO or EMPNAME wasn’t defined in your file.
Your second error
*RNF5063 30 1 Factor 2 operand must not be an externally
could be one of two lines your listing will tell you specifically which.
C exfmt mbrw <– this must be a record name in the file roughdsp
C write emp1 <- this must be the record format name not the file name
If you type DSPFD EMP1 you will see a description of the file emp1 including the record format name.
Phil
There is no error that refers to duplicate definitions, so we’re pretty sure that the record format name is not EMP1. (The error might not be shown, but I don’t think that we’d see a RNF5063 if the file and format had the same name.)
Phil’s suggestion for using DSPFD will show you the record format name. Your compile listing should also show that record format name for the EMP1 file.
The error is telling you that you can’t use the file name. We can be pretty sure that the error doesn’t apply to the EXFMT because the file name isn’t used there. It almost has to be the WRITE statement.
So don’t use the file name on the WRITE statement. Change the statement. Use the record name.
Tom
But most important, spend a little more time with the compile listing, you aren’t getting as much out of it as you should.
Phil