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

85 pts.
Tags:
CLLE
DSPFD
RCVF
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)

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question:  

 
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

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