Question

  Asked: Apr 3 2008   6:45 AM GMT
  Asked by: It doubts


To get a perticular string details from all the members of a file


CLLE, RCVF, DSPFD

Here i am doing get all the member names from the perticular file. for that use dspfd command and pertilular MBRLST and the output instead of displaying saving in a file and reading that file in aloop CL program using RCVF command and overriding the file with the each memberthen call the program in that program reading from overrided file and compare the account number and if its same display the output
*************** ******************************
0001.00 PGM
0001.01 DCLF FILE(NTEUSR/CLDSP) RCDFMT(CLDSPREC) OPNID(N001)
0002.00 DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
0002.01 DCL VAR(&TWO) TYPE(*CHAR) LEN(10)
0002.02 DCL VAR(&FNAME) TYPE(*CHAR) LEN(10)
0003.00 /* TEMPORARY FILE WHICH STORES THE MEMBER INFO */
0004.00 DCLF FILE(QTEMP/MBRLST)
0004.01 SNDRCVF RCDFMT(CLDSPREC) OPNID(N001)
0005.00 MONMSG MSGID(CPF0000)
0005.01 /* DLTF FILE(QTEMP/MBRLST) */
0006.00 DSPFD FILE(NTEUSR/&FILE) TYPE(*MBRLIST) +
0007.00 OUTPUT(*OUTFILE) OUTFILE(QTEMP/MBRLST) +
0007.01 OUTMBR(CLPFOUT)
0007.02 CLRPFM FILE(CLPFOUT)
0007.03 MONMSG MSGID(CPF0000)
0010.00 LOOP: RCVF OPNID(N001) in this program one error occur i cant find out the error please help to find out error. the error is
4>> CALL NTEUSR/CLTESTM

Value ' ' for FILE not a name or generic name.
Error found on DSPFD command.
Function check. CPF0001 unmonitored by CLTESTM at statement 0000000600,
instruction X'0000'.
CPF0001 received by procedure CLTESTM. (C D I R)
CPF0001 received by procedure CLTESTM. (C D I R)

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



Hi,

Some important things are missing into your program.

The dspfd *MBRLIST into an outfile would give you a list of all members. The variable name contaninig the members is "MLNAME" in the outfile.

If I were you, I would rather do it that way:

- Consider that the program called (line 8.00) is the one who will tell you if the account in gound or not. This program should initialize the &FOUND variable to 'N' before doing it's verification.
- Consider to call the actual program with a parameter giving the file name to verify.
- Consider that before compiling that program, you will have to create a file into QTEMP named MBRLIST by doing a DSPFD with and outfile named MBRLIST in QTEMP and compile interractively.

Here we go !

0001.00 PGM PARM(&FILE)
0002.00 DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
0002.01 DCL VAR(&FOUND) TYPE(*CHAR) LEN(1)
0002.02 DCLF FILE(QTEMP/MBRLIST)
0003.00 DSPFD FILE(YOURLIB/&FILE) TYPE(*MBRLIST) +
0004.00 OUTPUT(*OUTFILE) OUTFILE(QTEMP/MBRLIST)
0005.00 LOOP: RCVF RCDFMT(QWHFDML)
0006.00 MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDPGM))
0007.00 OVRDBF FILE(&FILE) TOFILE(YOURLIB/&FILE) MBR(&MLNAME)
0008.00 CALL PGM(YOURLIB/YOURPGM) PARM(&FOUND)
0008.01 DLTOVR FILE(&FILE)
0009.00 IF COND(&FOUND = 'Y') THEN(DO)
0009.01
0010.00 /* HERE YOU DO WHATEVER IT TAKE'S IF THE ACCOUNT IS FOUND */
0010.01
0011.00 ENDDO
0012.00 GOTO CMDLBL(LOOP)
0013.00 ENDPGM: ENDPGM

Have fun !

DanTheMan
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register