I have a header and detail files that are multi member. I am trying this approach:
to process the main member first qry it and copy it to same filename but different library and different member. Then I process the archive member and do the same thing but adding it to the same member/file/library where I copy the records from the first opnqry(for the main member).
Problem is it is not doing it. When I look at the file in qtemp that the cpyfrm qry had CREATED(not updated), It contains the main and the archive member. Why is the 2nd cpyfrmqry not adding the records to the member specified? why is it creating a new member? Actually even the first cpyfrmqry is not putting it to member TEST01 but rather putting it to the same member as the from member name.
Please help. Thanks.
* Process Main Member
OVRDBF FILE(HDRFILE) MBR(HDRFILE)
OVRDBF FILE(DTLFILE) MBR(DTLFILE)
OPNQRYF FILE((DTLFILE) (HDRFILE)) FORMAT(DTLFILE)+
QRYSLT(&QRYSLT) KEYFLD((SIONO) (SISEQ) +
(SICLS) (SIVEN) (SISTY) (SICLR)) +
JFLD((SIONO SHONO)) MAPFLD((S1SDTE 'SHNBDT'))
CPYFRMQRYF FROMOPNID(DTLFILE) TOFILE(QTEMP/DTLFILE) +
TOMBR(TEST01) MBROPT(*REPLACE) CRTFILE(*NO)
DLTOVR FILE(HDRFILE)
DLTOVR FILE(DTLFILE)
CLOF OPNID(DTLFILE)
/* Archive Member */
OVRDBF FILE(HDRFILE) MBR(ARCHIVE)
OVRDBF FILE(DTLFILE) MBR(ARCHIVE)
OPNQRYF FILE((DTLFILE) (HDRFILE)) +
FORMAT(DTLFILE) QRYSLT(&QRYSLT) +
JFLD((SIONO SHONO)) MAPFLD((S1SDTE 'SHNBDT'))
CPYFRMQRYF FROMOPNID(DTLFILE) TOFILE(QTEMP/DTLFILE) +
TOMBR(TEST01) MBROPT(*ADD) CRTFILE(*NO)
to process the main member first qry it and copy it to same filename but different library and different member. Then I process the archive member and do the same thing but adding it to the same member/file/library where I copy the records from the first opnqry(for the main member).
Problem is it is not doing it. When I look at the file in qtemp that the cpyfrm qry had CREATED(not updated), It contains the main and the archive member. Why is the 2nd cpyfrmqry not adding the records to the member specified? why is it creating a new member? Actually even the first cpyfrmqry is not putting it to member TEST01 but rather putting it to the same member as the from member name.
Please help. Thanks.
* Process Main Member
OVRDBF FILE(HDRFILE) MBR(HDRFILE)
OVRDBF FILE(DTLFILE) MBR(DTLFILE)
OPNQRYF FILE((DTLFILE) (HDRFILE)) FORMAT(DTLFILE)+
QRYSLT(&QRYSLT) KEYFLD((SIONO) (SISEQ) +
(SICLS) (SIVEN) (SISTY) (SICLR)) +
JFLD((SIONO SHONO)) MAPFLD((S1SDTE 'SHNBDT'))
CPYFRMQRYF FROMOPNID(DTLFILE) TOFILE(QTEMP/DTLFILE) +
TOMBR(TEST01) MBROPT(*REPLACE) CRTFILE(*NO)
DLTOVR FILE(HDRFILE)
DLTOVR FILE(DTLFILE)
CLOF OPNID(DTLFILE)
/* Archive Member */
OVRDBF FILE(HDRFILE) MBR(ARCHIVE)
OVRDBF FILE(DTLFILE) MBR(ARCHIVE)
OPNQRYF FILE((DTLFILE) (HDRFILE)) +
FORMAT(DTLFILE) QRYSLT(&QRYSLT) +
JFLD((SIONO SHONO)) MAPFLD((S1SDTE 'SHNBDT'))
CPYFRMQRYF FROMOPNID(DTLFILE) TOFILE(QTEMP/DTLFILE) +
TOMBR(TEST01) MBROPT(*ADD) CRTFILE(*NO)