× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 23-Jun-2017 07:57 -0600, Smith, Mike wrote:
So I'm having a strange issue retrieving a directory listing from
the IFS. V7R1

Below is a snippet.

DCLF FILE(DIRLIST)

/* change to fidelity path in IFS */
CD DIR(&PATH)

DLTF FILE(QTEMP/DIRLIST)
MONMSG MSGID(CPF0000)

Note re above: Monitor for *only* the message(s) that should be ignored; e.g. CPF2105. Ignoring all conditions is, at best, poor programming; unexpected conditions are not reported, and having been ignored, may result in later effects that are subtle [subtly incorrect] and thus difficult to debug.


/* override the output to file dirlist */
OVRDBF FILE(STDOUT) TOFILE(QTEMP/DIRLIST) +
OVRSCOPE(*CALLLVL)

OVRDBF FILE(DIRLIST) TOFILE(QTEMP/DIRLIST)

Note re above: There may be benefits to being explicit with Override Scope (OVRSCOPE) in [both] overrides.


/* use qshell command to list contents of */
/* Fidelity directory to file dirlist */
QSH CMD('LS -LT *.*')

Note re above: consider the difference for "asterisk dot asterisk" shown, and just "asterisk"

CPYF FROMFILE(QTEMP/DIRLIST) TOFILE(*PRINT)

FIDELO:
RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

The above is a from a program that is 2 different versions. The only
difference between the 2 programs is the CPYF after the QSH.

When I use the version that has the CPYF, the program works like it
is supposed to and reads the file.

However when I use the version that does not have the CPYF I get a
CPF0886 is: Record contains a data field that is not valid.

I stuck the CPYF in the program so I could see what was in the QTEMP
file and then it started behaving.

Any ideas?


Recompiling the original program, from unchanged source, I presume, would have the same /corrective/ effect as compiling the version with the added Copy File (CPYF) request; i.e. the listing from the original CLP that would show the qualified file name and record format details for the Declare File (DCLF) statement, likely shows some effective incompatibility between the file QTEMP/DIRLIST created at run-time, and the file used for the CRTCLPGM. If such a recompile is not corrective, then providing the compile listing and the Display File Field Description (DSPFFD) of the "QUALIFIED FILE NAME" from the listing might enable someone to re-create the issue and investigate further.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.