Page 1 of 1

File Manager in Batch: excluding all records, find records and deleting non-excluded finds

Posted: Fri Nov 12, 2021 2:08 am
by tonynix
I'm a newbie to IBM FM. I have an ISPF edit dialog where I open a PDS member, do an EXCLUDE ALL, then FIND 'string' ALL, then DEL NX ALL. I'm having trouble finding good examples in the IBM User Guide. I've tried using the FCH function. When I run my batch job with PGM=FILEMGR, and a SYSIN card of F "string" ALL, FM gives back all the records. However, when I try EXCLUDE ALL as the preceding line to the FIND command, FM tells me the EXCLUDE command is invalid.

Here are my

Code: Select all

//SYSIN cards:
$$FILEM FCH DSNIN='libname(pdsmem)'
EXCLUDE ALL
F "ID(string)" ALL
DEL NX ALL
Output gives me a FMNBA017: Invalid command: EXCLUDE

What am I doing wrong?

TIA, Tony

Re: File Manager in Batch: excluding all records, find records and deleting non-excluded finds

Posted: Fri Nov 12, 2021 4:57 pm
by Anuj Dhawan
Every command in batch for IBM File Manager should precede with "$$FILEM", try that for 'EXCLUDE' and other commands.


PS.: Please note, my current shop does not use IBM File Manager, so this is off the bat.

Re: File Manager in Batch: excluding all records, find records and deleting non-excluded finds

Posted: Fri Nov 12, 2021 7:41 pm
by tonynix
Hi Anij,
Good suggestion, so I tried adding $$FILEM ahead of each of the EXCLUDE, FIND, and DEL commands. FM didn't like that. I get two new error messages: FNMBB334 "PROC=* specified with no following cards", and FMNBE098 "Keyword verification discontinued for any subsequent command."

What's strange to me is that those three commands work exactly in the ISPF EDIT screen as they're typed in the SYSIN. I would think that IBM would be consistent where you can use the same command syntax in batch as online.

The doc does say in come of the functions that it's online only.

Re: File Manager in Batch: excluding all records, find records and deleting non-excluded finds

Posted: Fri Nov 12, 2021 9:58 pm
by Anuj Dhawan
Not sure if I've misunderstood but why do you believe that 'ISPF edit commands' and commands for 'IBM File Manager' should work just same?

If you write an ISPF Edit Macro, commands will work in same fashion as in an ISPF edit panel.