SQLRPGLE program results nothing

820 pts.
Tags:
IBM iSeries
SQLRPGLE
Hi, 
I am new to SQLRPGLE. I have coded something, which finally shows nothing.Please have a look on my code & kindly help me to get the output.
This is my program
        *************** Beginning of data ************************************
0001.00 HDEBUG(*YES)                                                          
0002.00 DMYDS             DS            50                                    
0003.00 DNAME                     1     10A                                   
0004.00 DID                      12     18S 0                                 
0005.00 DGRADE                   20     21A                                   
0006.00 DTENURE                  23     27S 0                                 
0007.00 DADDRESS                 29     35A                                   
0008.00 DSEPT                    37     41A                                   
0009.00 DSEARCHID         S                   LIKE(ID)                        
0010.00 C/EXEC SQL                                                            
0011.00 C+ DECLARE C9 SCROLL CURSOR WITH HOLD FOR SELECT                      
0012.00 C+ NAME,ID,GRADE,TENURE,ADDRESS,SEPT FROM TWILIGHT1/FILE1 WHERE       
0013.00 C+ ID=:SEARCHID                                                       
0014.00 C/END-EXEC                                                            
0015.00 C/EXEC SQL                                                            
0016.00 C+ OPEN C9                                                            
0017.00 C/END-EXEC                                                            
0018.00 C/EXEC SQL                                                            
0019.00 C+ FETCH NEXT FROM C9 INTO :MYDS                                      
0020.00 C/END-EXEC
0021.00 C                   DOW       SQLSTATE='00000'
0022.00 C     MYDS          DSPLY
0023.00 C/EXEC SQL
0024.00 C+ FETCH NEXT FROM C9 INTO :MYDS
0025.00 C/END-EXEC
0026.00 C                   ENDDO
0027.00 C/EXEC SQL
0028.00 C+ CLOSE C9
0029.00 C/END-EXEC
0030.00 C                   SETON                                        LR
        ****************** End of data ********************************************
This is my procedure
CREATE PROCEDURE TWILIGHT1/PROC220(IN :SEARCHID DEC (7 , 0)) RESULT
SETS 1 LANGUAGE RPGLE NOT DETERMINISTIC READS SQL DATA EXTERNAL
NAME TWILIGHT1/PGM3 PARAMETER STYLE GENERAL
This is my CALL statement.
CALL TWILIGHT1/PROC220 (1)
CALL statement complete.
After that this I can get from the DSPJOBLOG.
2 > DSPJOBLOG
2 > STRSQL
    Job 328436/TWILIGHT/QPADEV003B changed by JOBMANAGER.
    Job 328436/TWILIGHT/QPADEV003B changed by JOBMANAGER.
 kindly let me, know. what I need to change here.


Software/Hardware used:
SQLRPGLE

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: 6  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
    SEARCHID appears to not be defined as an entry parameter for this program, if that is the entire RPGLE source.  assuming pgm3 is the name of the program...

    replace this
     DSEARCHID         S                   LIKE(ID)
    with this
    D PGM3            PR                          
    D  SEARCHID                           LIKE(ID)
    D PGM3            PI                          
    D  SEARCHID                           LIKE(ID)

    8,220 pointsBadges:
    report
  • HABBIE
    @BigKat I can see nothing, after replacing the changes.Still with the same issue.

    820 pointsBadges:
    report
  • BigKat
    try
    C+ DECLARE C9 SCROLL CURSOR WITH HOLD FOR SELECT                      
    C+ NAME,ID,GRADE,TENURE,ADDRESS,SEPT FROM TWILIGHT1/FILE1 WHERE       
    C+ ID=?                                                      
    C/END-EXEC                                                            
    C/EXEC SQL                                                            
    C+ OPEN C9 using :SEARCHID                                                           
    C/END-EXEC          

    8,220 pointsBadges:
    report
  • philpl1jb

    Perhaps because, your data structure isn't the same layout as your program.  But it more important that you get to see the errors .. I would put this after every sql  block .. then check the dumps for the SQL Code, SQL State and a whole bunch of sql data ..

    If SqlCode <> '00000';

       Dump;

    Endif

     

    I don't know if a dsply will work in a stored procedure.

    50,205 pointsBadges:
    report
  • BigKat
    as long as it is not in batch, DSPLY should work
    8,220 pointsBadges:
    report
  • BigKat
    but as philpl1jb said, I suspect you have an SQL error and that is why you aren't seeing anything.  SQLState is never 00000
    8,220 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