200 pts.
 As400/CLLE issue
i made a PGM for read as well as write the record in DSPF but my PGM doesn`t read that PF it not showing any error .. it shows Blank value in varible.
PGM                                                                             
             DCL        VAR(&WS) TYPE(*CHAR) LEN(10) /* variable */             
             DCL        VAR(&WSPID4) TYPE(*CHAR) LEN(10) /*DSPF field*/         
             DCL        VAR(&PDPID) TYPE(*CHAR) LEN(10)  /*PF FIELD*/           
             DCLF       FILE(KRGUNN/TP001P)  OPNID(OP1)  /*PF*/                 
             DCLF       FILE(KRGUNN/TPW005D) RCDFMT(RECDSP) /*DSPF*/            
             OPNDBF     FILE(KRGUNN/TP001P) OPTION(*INP) OPNID(OP1)             
             POSDBF     OPNID(OP1) POSITION(*START)                             
             RCVF       RCDFMT(RTP001P) OPNID(OP1) /*READ PF*/                  
             CHGVAR     VAR(&WS) VALUE(&PDPID) /*MOVE PF VALUE TO VARIABLE*/    
             CHGVAR     VAR(&WSPID4) VALUE(&WS) /*MOVE VARIABLE TO DSPF FLD*/   
             SNDRCVF    RCDFMT(RECDSP)                                          
             CLOF       OPNID(OP1)                                              
 EXIT:       ENDPGM                                                             


Software/Hardware used:
i-series
ASKED: February 14, 2012  7:18 AM
UPDATED: March 17, 2012  1:32 AM

Answer Wiki:
hi .... Use fallowing reference.. PGM DCL VAR(&WS) TYPE(*CHAR) LEN(10) /* variable */ DCL VAR(&WSPID4) TYPE(*CHAR) LEN(10) /*DSPF field*/ DCLF FILE(KRGUNN/TP001P) OPNID(OP1) /*PF*/ DCLF FILE(KRGUNN/TPW005D) RCDFMT(RECDSP) OPNID(OP2) /*DSPF*/ LOOP: SNDRCVF RCDFMT(RECDSP) OPNID(OP2) RCVF RCDFMT(RECF OF PF) OPNID(OP1) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) /* TO CHECK END OF FILE */ CHGVAR VAR(&WS) VALUE(&OP1_PDPID) /* SYNTAX OF MOVEING FIELD VALUE WITH OPEN ID IDENTIFIER */ CHGVAR VAR(&OP2_WSPID4) VALUE(&WS) IF COND(&OPB_IN03 = '0') THEN(GOTO CMDLBL(LOOP)) /* F3 INDICATOR IN DSPF */ END: ENDPGM
Last Wiki Answer Submitted:  February 14, 2012  8:45 am  by  SMisar   130 pts.
All Answer Wiki Contributors:  SMisar   130 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

THANKS ITS WORK NOW…

 200 pts.

 

DCL VAR(&WS) TYPE(*CHAR) LEN(10) /* variable */
DCL VAR(&WSPID4) TYPE(*CHAR) LEN(10) /*DSPF field*/
DCL VAR(&PDPID) TYPE(*CHAR) LEN(10) /*PF FIELD*/

Why are those three lines in the program? How does your program ever put a value into &PDID? Where do you move any values into your display fields? None of those variables are part of the physical file nor of the display file.

Tom

 108,155 pts.

 

Hi Tom u r right

DCL VAR(&WS) TYPE(*CHAR) LEN(10) /* variable */
DCL VAR(&WSPID4) TYPE(*CHAR) LEN(10) /*DSPF field*/
DCL VAR(&PDPID) TYPE(*CHAR) LEN(10) /*PF FIELD*/

these three lines are not require to add in pgm … Bcoz we can directly move the pf field value to DSPF no need to declare. But I was just adding for his reference… I dont know why he has taken that line…

 130 pts.

 

I dont know why he has taken that line…

I asked so that the OP would have to think about them. By talking about them, we could understand how fields from declared files are automatically made available in a CL program.

I believe that discussion is better than only providing code. It allows some learning of principles.

Tom

 108,155 pts.

 

Ya…. But it is not possiblae to explain line by line code here…. Thats better to provide correct solution where required… I agree discusion is better but some times…

 130 pts.

 

I agree discusion is better but some times…

The site prohibits providing direct solutions for “homework” questions.

The example CL was clearly at a “learning” level. In order to determine the reason behind asking the question, some dialog is required first.

Tom

 108,155 pts.

 

Ok Man cool down thats not any political issue to expnad our discussion… Just leave it and cool down…………

 130 pts.

 

Tom, you are right on it. Basic homework question.

 3,175 pts.