I have a multiple member physical file and I want to operate(read/update/delete) with specific member in RPG. The member name for that PF need to be set at runtime depending upon from which program this rpg program is called.
I am writing the sample code that I was trying, but it ends up with compilation errors on setll and read statements.
FFileA IF F 731 Disk Extfile(File)
F Extmbr(Mbr)
F Usropn
FFile1 UF A E K Disk
DFile S 10 Inz(' ')
DMbr S 10 Inz(' ')
c *entry plist
c parm pgmname
c*
c eval File = 'File1'
c if pgmname = 'Pgm1'
c eval Mbr = 'Mbr1'
c endif
c if pgmname = 'Pgm2'
c eval Mbr = 'Mbr2'
c endif
c open FileA
c *loval setll FileA
c read FileA
c dow not %eof(FileA)
c* rcdfmt is record format name of File1
c delete rcdfmt
c read FileA
c enddo
Thanks & regards,
Alok.
Software/Hardware used:
ASKED:
November 18, 2005 12:06 AM
UPDATED:
November 20, 2009 7:50 AM
It’s one thing to say that an error occurs on a particular statement. It’s altogether something different to say what the error is.
BTW, your program doesn’t make any sense. Is there meaning to setting File = ‘File1′ and also having a F-spec for File1? And how are you expecting the DELETE statement to do anything if you haven’t done any input or even positioning for File1? Surely you’re not expecting the ‘File1′ and File1 to somehow mean the same thing?
The compiler can’t read your mind. It cannot predict what value be put into the File variable.
Tom