RPGLE opcode similar to SNDF in CL

45 pts.
Tags:
CL
RPGLE
SNDF
Is there any way we can display a message "Processing" while the program is building the data in a subfile. In CL we can use the SNDF command to send such message to the display. Please help.

Answer Wiki

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

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
  • BigKat
    I have used this Progress Meter method by Martin Rowe
    8,030 pointsBadges:
    report
  • TomLiotta
    Perhaps you can just send a *STATUS message while processing, and send a blank message when finished. The RPG op-code that matches with SNDF is WRITE. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    If a progress meter is wanted, one can be generated easily enough. Here's a basis for a progress bar in CL that can be modified to be as fancy as needed:
    pgm    ( +
             &pRow        +
             &pColumn     +
           )
    
       dcl   &pRow        *int
       dcl   &pColumn     *int
    
       dcl   &hCmdBuf     *int           value( 0 )
       dcl   &hLoLvlEnv   *int           value( 0 )
       dcl   &RtnVal      *int
    
       dcl   &ErrCod      *char    8     value( x'00000000' )
    
       dcl   &intAstrx    *int           value( 92 )   /* '*' as *INT  */
    
       dcl   &Data        *char  128
       dcl   &DataL       *int
       dcl   &FldId       *int           value( 0 )
       dcl   &Column      *int           value( 1 )
       dcl   &StrMAtr     *char    1     value( x'20' )
       dcl   &EndMAtr     *char    1     value( x'20' )
       dcl   &StrColAtr   *char    1     value( x'26' )
       dcl   &EndColAtr   *char    1     value( x'20' )
    
    
       if ( &pColumn *gt 80 )  +
          chgvar         &pColumn    ( 1 )
    
       callprc     'memset' ( &Data (&intAstrx *byval) (&pColumn *byval) )
    
       chgvar            &DataL        &pColumn
       chgvar            &pColumn    ( &pColumn + 1 )
    
       callprc 'QsnWrtDta'      ( +
                                  &Data        +
                                  &DataL       +
                                  &FldId       +
                                  &pRow        +
                                  &Column      +
                                  &StrMAtr     +
                                  &EndMAtr     +
                                  &StrColAtr   +
                                  &EndColAtr   +
                                  &hCmdBuf     +
                                  &hLoLvlEnv   +
                                  &ErrCod      +
                                ) +
                          rtnval( +
                                  &RtnVal      +
                                )
    
       return
    
    endpgm
    This is a test program to call it:
    pgm    ( +
           )
    
       dcl   &Column      *int            value( 1 )
       dcl   &i           *int
       dcl   &j           *int            value( 24 )
    
    
       dofor &i from( 1 ) to( 100 )
          call     DSMPRGBAR ( &j &Column )
          dlyjob   ( 1 )
       enddo
    
       return
    
    endpgm
    As written, it displays a row of asterisks progressing from column 1 to column 80 of row 24. When it reaches column 80, it shifts back to column 1. The asterisks can be changed to be any displayable character by changing the decimal value of the variable &intAstrx. The color and other attributes can be changed by setting the values of the appropriate variables passed into the DSM Write Data (QsnWrtDta) API. In this case, x'26' sets the White/Underline display attribute at the beginning (on a color display) and back to x'20' -- Green/Normal -- at the end. The test program calls the progress bar program in a loop. This might be done by a subfile-load program once every hundred rows are loaded or at some other interval. Of course, very few subfiles should ever take more than a second or so before being displayed, so a progress bar or status message wouldn't be on screen very long. Tom
    125,585 pointsBadges:
    report
  • ToddN2000
    I agree that a "Processing" status should not be needed. If your subfile is that large, you should be building it a page at a time. We have some applications over our audit file (12 mil records). We build it a page at a time and have no preformance issues. When the user pages down the next page is built and displayed. Is your issue needing the "Processing" status a home grown application or part of a purchased software system?
    9,690 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