Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System/36 files

Status
Not open for further replies.

SuzieW

Programmer
Dec 17, 2002
41
GB
I'm trying to read a System/36 file from an RPGLE program (don't ask me why they've still got S36 files). I cribbed from another program and just changed the file name.

But when I run the program it falls over with a CPF4101 (file not found) even though I've checked and the file is in the library list at run time.

My F spec is as follows:

Code:
FFILENAM   IF   F  256     7AIDISK    KEYLOC(58)

The file is called FILE.NAM (with name changed to protect the innocent) in the S36 environment but the program I cribbed from didn't have the dot - I'm guessing RPG doesn't like it?

Then I've got an I spec which precedes the file layout:

Code:
IWMOERPD   NS  01

I'm the only RPG developer here and I haven't worked with S36 stuff before so I haven't a clue what I'm doing really. I've googled and can't find anything useful.

Help would be greatly appreciated! I've probably done something really stupid so apologies in advance...
 
The more observant amongst you will notice that in the I spec, I neglected to change the name to protect the innocent.

Suffice it to say, in real life, the filenames in the F spec and I spec are the same...

Sorry for the confusion - it is Friday afternoon after all...
 
Try using the EXTFILE keyword to point FILENAM to FIL.NAM.

Put EXTFILE(FIL.NAM) on the F-spec for FILNAM. Ought to work, but it's been 10 years and 2 jobs ago that I last dealt with S/36EE stuff.

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
YOu probably need to do a ovrdbf cl statement, because 36 files are keep in a different library, usually the QS36F, and it would be better if you changed the F and I spec,,, also,,, depending on what you want to do,, you should wite the RPG program in system 36 style, to ensure it works properly. Or you can always do a PF definition, on the AS400 side, and do a CPYF file,, with a *nochk, as an option.
F and I specs follow.

0003 FOPRDTL UP F 128 128 2 DISK
0010 IOPRDTL AA 01 1NCD
I 2 50JOBN
0012 I 7 110CC
0012 I 12 140LINE
0020 I BB 03
 
EXTFILE will let you specify the library: EXTFILE(QS36F/FIL.NAM). That's really the only reason I use it.

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
Thanks guys

On further investigation, I think my predecessor may have copied the file to an AS400 copy before running the program as suggested by jmd0252. So I'll give that a try.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top