Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

CODE Designer and prototype report

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CODE Designer and prototype report

    I had the same need, so I wrote a small utility to print prototypes. Denny PRTPRTF Utility. This command reads a printer file DDS source member, creates a RPG IV source member to print the DDS, compiles and executes the RPG program. This is useful for documenting external printer files and producing prototypes during the development phase. *** PRTPRTF QCMDSRC *** /* Print Sample of Ext Print File */ /* +-------------------------------------------------------------------+ */ /* | This program is the property of: | */ /* | ProMIS, R. D. Davis Copyright 2004 | */ /* | 1716 Cove Point | */ /* | Gainesville, GA 30501-1468 | */ /* | 770-297-9929 denny@techie.com | */ /* +-------------------------------------------------------------------+ */ /* | Date written: 04/05/04 Author: R. D. Davis | */ /* | Date modified: XX/XX/XX By: RDD | */ /* | | */ /* +-------------------------------------------------------------------+ */ CMD PROMPT('Print Sample of Ext Print File') PARM KWD(MBR) TYPE(*NAME) LEN(10) MIN(1) + PROMPT('Printer File Source Member') PARM KWD(LIBRARY) TYPE(*NAME) LEN(10) + SPCVAL((*LIBL)) PROMPT('Printer File & + QDDSSRC library') *** PRTPRTF QCLSRC *** /* Print sample of External Printer File */ /* */ /* +-------------------------------------------------------------------+ */ /* | This program is the property of: | */ /* | ProMIS, R. D. Davis Copyright 2004 | */ /* | 1716 Cove Point | */ /* | Gainesville, GA 30501-1468 | */ /* | 770-297-9929 denny@techie.com | */ /* +-------------------------------------------------------------------+ */ /* | Date written: 04/05/04 Author: R. D. Davis | */ /* | Date modified: XX/XX/XX By: RDD | */ /* | | */ /* +-------------------------------------------------------------------+ */ PGM PARM(&DDSMBR &DDSLIB ) DCL &DDSMBR *CHAR 10 DCL &DDSLIB *CHAR 10 DCL &ABEND *LGL DCL &MSGDTA *CHAR 132 DCL &MSGID *CHAR 7 DCL &MSGF *CHAR 10 DCL &MSGFLIB *CHAR 10 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ABEND)) CHKOBJ OBJ(QTEMP/QRPGLESRC) OBJTYPE(*FILE) MBR(PRTSAMPLE) MONMSG CPF9801 EXEC(DO) /* FILE NOT FOUND */ RCVMSG MSGTYPE(*EXCP) RMV(*YES) CRTSRCPF FILE(QTEMP/QRPGLESRC) RCDLEN(112) MBR(*NONE) + MAXMBRS(*NOMAX) SIZE(*NOMAX) AUT(*ALL) ADDPFM FILE(QTEMP/QRPGLESRC) MBR(PRTSAMPLE) + SRCTYPE(RPGLE) ENDDO MONMSG CPF9815 EXEC(DO) /* MEMBER NOT FOUND */ RCVMSG MSGTYPE(*EXCP) RMV(*YES) ADDPFM FILE(QTEMP/QRPGLESRC) MBR(PRTSAMPLE) + SRCTYPE(RPGLE) ENDDO CLRPFM FILE(QTEMP/QRPGLESRC) MBR(PRTSAMPLE) OVRDBF FILE(QRPGLESRC) TOFILE(QTEMP/QRPGLESRC) + MBR(PRTSAMPLE) OVRDBF FILE(QDDSSRC) TOFILE(&DDSLIB/QDDSSRC) + MBR(&DDSMBR) DSPFFD FILE(&DDSLIB/&DDSMBR) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/DSPFFD) OVRDBF FILE(QADSPFFD) TOFILE(QTEMP/DSPFFD) CALL PRTPRTF1 &DDSMBR CRTBNDRPG PGM(QTEMP/SAMPLE) SRCFILE(QTEMP/QRPGLESRC) + DFTACTGRP(*NO) ACTGRP(*CALLER) OUTPUT(*NONE) OVRPRTF FILE(&DDSMBR) PRTTXT(*BLANK) CALL PGM(QTEMP/SAMPLE) EXIT: RETURN /* NORMAL END OF JOB */ ABEND: IF COND(&ABEND) THEN(SNDPGMMSG MSGID(CPF9898) + MSGF(QCPFMSG) MSGDTA('Function check.') + MSGTYPE(*ESCAPE)) CHGVAR VAR(&ABEND) VALUE('1') DMPCLPGM /* Forward diagnostic messages from this program message queue to previous */ FORWARD: RCVMSG MSGTYPE(*DIAG) RMV(*NO) MSGDTA(&MSGDTA) + MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF (&MSGID ¬= ' ') DO SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*DIAG) GOTO FORWARD ENDDO RCVMSG MSGTYPE(*EXCP) RMV(*NO) MSGDTA(&MSGDTA) + MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGFLIB) IF (&MSGID ¬= ' ') DO SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) + MSGDTA(&MSGDTA) MSGTYPE(*ESCAPE) ENDDO ENDPGM *** PRTPRTF1 QRPGLESRC (Source type is SQLRPGLE) *** H/TITLE Print sample of External Printer File ** +--------------------------------------------------------------+ ** | This program is the property of: | ** | ProMIS, R. D. Davis Copyright 2004 | ** | 1716 Cove Point | ** | Gainesville, GA 30501-1468 | ** | 770-297-9929 denny@techie.com | ** +--------------------------------------------------------------+ ** | Date written: 04/05/04 Author: R. D. Davis | ** | Date modified: XX/XX/XX | ** | | ** +--------------------------------------------------------------+ H bnddir('QC2LE') Fqddssrc ip f 92 disk Fqrpglesrc o f 112 disk D f_spec ds 112 D f_seq 1 6 0 inz D f_id 18 18 inz('F') D f_file 19 28 D f_o 29 29 inz('o') D f_f 34 34 inz('e') D f_dev 48 57 inz('printer') D c_spec ds 112 D c_seq 1 6 0 inz D c_id 18 18 inz('C') D factor_1 24 37 D oper 38 47 D Factor_2 48 61 D Factor2 48 92 D Result 62 75 D p_record_name s like(record_name) D ffd e ds extname(qadspffd) Iqddssrc ns 01 19 c* I ns 02 29 cR I 31 40 record_name I ns 03 31nc I 31 40 field_name I 41 41 Ref_field I 49 49 Dec_Pos I ns 04 C if *in02 C and p_record_name <> record_name C if p_record_name <> *blank C eval oper = 'write' C eval factor_2 = p_record_name C eval f_seq = f_seq + 100 C write qrpglesrc c_spec C reset c_spec C endif C eval p_record_name = record_name C endif C if *in03 C if ref_field = 'R' C/Exec sql C+ select * C+ into :ffd C+ from QTEMP/DSPFFD C+ where Whflde = :field_name C/end-exec C select C when whfldt = 'L' C or whfldt = 'T' C or whfldt = 'Z' C eval oper = 'time' C eval result = field_name C eval c_seq = c_seq + 100 C write qrpglesrc c_spec C reset c_spec C when whfldt = 'B' C or whfldt = 'B' C or whfldt = 'S' C or whfldt = 'P' C or whfldt = 'F' C exsr number C when whfldt = 'A' C exsr character C endsl C else Not Reference Field C if dec_pos = *blank Character C exsr character C else Not Reference Field C exsr number C endif not Character C endif C endif Clr exsr lr C *inzsr begsr C *entry plist C parm file 10 C move file f_file C eval f_seq = f_seq + 100 C write qrpglesrc f_spec C eval c_seq = f_seq C endsr C character begsr C eval oper = 'move' C eval factor_2 = '*all''X''' C eval result = field_name C eval c_seq = c_seq + 100 C write qrpglesrc c_spec C reset c_spec C endsr C number begsr C eval oper = 'z-sub' C eval factor_2 = '*all''9''' C eval result = field_name C eval c_seq = c_seq + 100 C write qrpglesrc c_spec C reset c_spec C endsr C lr begsr C eval oper = 'write' C eval factor_2 = p_record_name C eval c_seq = c_seq + 100 C write qrpglesrc c_spec C reset c_spec C eval oper = 'eval' C eval factor2 = '*inlr = *on' C eval c_seq = c_seq + 100 C write qrpglesrc c_spec C reset c_spec C endsr *** END OF SOURCE *** "Jack McCoach" wrote in message news:c2nl50$a782$1@news.boulder.ibm.com... > Is there any way to print out a prototype of my PRTF in CODE Designer like > RLU? I have some users who want to see the report before I continue with > programming. > >

  • #2
    CODE Designer and prototype report

    The source code for the PRTPRTF utility got "reformated" when posted to this forum, so let's try again. The source is also available at www.code400.com. Search for PRTPRTF.

    Comment


    • #3
      CODE Designer and prototype report

      In the above procedure mentioned we are working with PRTF Source, is there any way out that we can work with object and not with the source, and get the same same result.

      Comment


      • #4
        CODE Designer and prototype report

        It could be reworked to do that. It reads thru the source to get the record format names, field names, field sizes and types. It then uses this information to create rpg iv source to load values into all the fiels and print all the record formats. So the prototype does come from the actual object. You could replace the processing of the source with two outfiles created from the printer file object. DSPFD to get the record formats and DSPFFD to get the fields and definitions. Just didn't think of that approch when I wrote PRTPRTF. Denny

        Comment


        • #5
          CODE Designer and prototype report

          I had started working on Prototype generation of PRTF without using the source PRTF. As the code is ready i will upload it. Alakh

          Comment


          • #6
            CODE Designer and prototype report

            Actually you only need the DSPFFD outfile. It has the record format name.

            Comment


            • #7
              CODE Designer and prototype report

              Is there any way to print out a prototype of my PRTF in CODE Designer like RLU? I have some users who want to see the report before I continue with programming.

              Comment


              • #8
                CODE Designer and prototype report

                Hi Denny Davis I have seen ur PRTF utility. Its good. Can u suggest me some of the things in this regard. I am working on PRTF utility which should work over Object. (I has already converted ur code to habdle it through Object) But it has some problems, it did not takes care of Indicators. The DSPFFD command do tell us the use of indicators but it did not tell us that which indicator is used against which field, also if we have repetition of same indicator then also it did not inform us. I am attaching u a PRTF source compile it and see results of DSPFFD command. Can u tell me how to deal with it. Thanks.

                Invoice SRC.txt

                Comment

                Working...
                X