|
Post by rprinceton on Aug 4, 2023 8:37:51 GMT -5
Hello, From a list of files being displayed in the FileManager tab, I can enter 'V' (View) and the file is displayed in View mode. It of course applies the default profile. This is fine, however when the file is being displayed I want to apply the desired profile (a predefined profile). In the command area I enter PROF A100 (a predefined profile) and it shows the profile attributes for A100. I want to apply profile A100 to the currently displayed file. I have tried the 'RELOAD' primary command but it does not reload the file with profile A100 applied. I can get it to work thru command line options, but I want to apply a predefined profile while I am in SPFLite directly. Is this doable? Please advise. Thanx in advance. RPrinceton
|
|
|
Post by Robert on Aug 4, 2023 10:25:11 GMT -5
Hi,
I would recommend trying to read the Help that describes profiles. It's important to understand basically how they work. Let me try to give you the reader's digest version.
1. Whenever a file is opened in SPFLite, it tries to determine what its "type" is. Suppose your file ends with an extension of .A100. If you have an existing profile of A100, then that is the profile that gets used. It does not matter whether you View, Browse or Edit.
2. When you say, "It of course applies the default profile", that is the source of your problem. Applying DEFAULT only happens if you never defined your own profile. If A100 has some special properties, the first thing you should do is create a profile for it. Try issuing HELP PROFILE for more information.
3. If you RELOAD, but didn't create a profile, that would be the cause of the problem. But, you say that PROF A100 displays the profile's attributes. So, it sounds like you want to superimpose the A100 attributes to a file whose type is *not* A100. Is that right?
4. If you are editing a non-A100 file, PROFILE A100 should do it. However, if you RELOAD, it might revert to the original file type, which was being treated as DEFAULT.
Something doesn't sound right here. Normally, people create profiles because they have long-standing file types that they edit on a regular basis. It's not typical to try to force some random file type to something else on the spur of the moment.
I suspect what you may have is TWO file types, one of which is actually A100, and the other is *like* A100 but with a different name. For laughs, say the 'other' type is B100.
My advice would be to set up an Extended File Type entry so that B100 files use the A100 profile. Then, all you have to do is open the file, and type A100 is used automatically.
Start with HELP EFT and try to set up an EFT entry. If you still have problems, post a description of what's going on. I feel certain can be easily fixed.
Robert
|
|
|
Post by rprinceton on Aug 4, 2023 12:22:09 GMT -5
Hi Robert, Thank you for your responses. For the record I've read the topics regarding profiles. I use SPFLite to edit/view mainframe files. Unlike PC files, the mainframe files do not rely on a file extension e.g., P.ABC.DEF will have completely different attributes from a file named T.DEF.DEF even though the last node i.e., ext in PC parlance is the same. When I create a file profile named A100 which has lrecl=100 EOF=none, SOURCE=EBCDIC it can be applied to any mainframe file that is 100 bytes in length irrespective of the file extension. My method does work when started with command C:\SPFLite2.exe -VIEW P.ABC.DEF .A100 In other words it does not rely on the extension to match the profile, but rather override it. I would think this could be done when the file is on display with something like RELOAD A100, or PROF APPLY A100. Hope this clarifies. Regards, RPrinceton
|
|
|
Post by Robert on Aug 4, 2023 13:26:32 GMT -5
Alright, now we're getting somewhere. I am an ex-mainframe guy so I am very familiar with the issues you are dealing with.
1. First of all, you have to decide what is the 'determining factor' that chooses which attributes to apply to a file. Of course, there is normally no need to replicate the exact naming conventions on the mainframe to your SPFLite data directory. If you do, and the mainframe's naming conventions aren't all that helpful, they won't be helpful in SPFLite either.
2. Suppose you were editing a COBOL program, and you downloaded it from the mainframe to your PC. (Yes, your file types may be different, but I want to try to use the example of COBOL here because it's simple and everyone knows it.)
Suppose the mainframe name was USER.TEST.COBOL(MYPROG); a very ordinary mainframe name. A typical way to name the downloaded PC file would be something like this:
C:\IBM\USER\TEST\COBOL\MYPROG
-OR-
C:\IBM\USER\TEST\COBOL\MYPROG.COB
Now, if you had added the .COB as part of your download process, you're all set - you'd just define a COB profile and you are done.
If your PC name was C:\IBM\USER\TEST\COBOL\MYPROG then the most likely way you "know" it's a Cobol file is by the name of the containing directory, COBOL.
Let's assume you had defined a COB profile already, but your MYPROG file doesn't have a usual PC extension on it. How do you get the right profile for it? By using EFT, the new SPFLite feature called Extended File Types.
What you want to do is define an EFT entry that says, "any time I have a file whose parent directory is "COBOL", I want the profile to be COB. To do that, issue an EFT primary command. This will bring up an EFT edit session (it's a lot like a CLIP edit or SET edit).
Then, insert a new line in the session that looks like this:
"**\COBOL\*" = COB
Then press F3 to end the EFT session.
Now, if you click on a file called "C:\ABC\COBOL\TEST", even though it has no extension, EFT will get applied, and because the file name 'fits the pattern', the associated profile name of COB gets applied. I just set up an EFT on my system with this exact format, and created just such a file, and I confirmed that it works as claimed.
In your example, you have files P.ABC.DEF and T.DEF.DEF. What's the determining factor? Is is P vs. T? That I would understand, but if it's ABC vs. DEF, and they also have DEF as an 'extension', it's not a very good naming convention. If you have to do it that way anyhow, then it sounds like you just "know" what the file types are, and the names don't actually help very much in figuring it out.
You can still do it, but it will take a little more work. EFT is very flexible. When your file names don't follow any reasonable pattern, you can go in and create a unique EFT specification for every single file name. EFT is mainly designed to match "patterns", but it is possible for the pattern to be an exact file name - without ANY 'wildcard' codes like * or ? in them.
It's really best if you don't do it that way, because THEN you may need a LOT of EFT entries to get everything you need. On the other hand, an EFT edit session gives you the full power of the SPFLite editor, so if that's how you're going to do it, it can certainly be done. All depends how much work you want to do in order to pull it off.
(PS. If P vs. T is the deciding factor, you could create EFT entries that use them.)
Hope this helps.
Robert
|
|
|
Post by George on Aug 5, 2023 3:44:25 GMT -5
Guys: I didn't read the whole thread thoroughly, but don't forget
you can specify the Profile name in FM with simply .prof-name as a line command.
similarly on the command line with .profname (before the filename which is always last)
Warning: this is akk from memory, I can't test right now.
George
|
|
|
Post by Robert on Aug 5, 2023 10:30:15 GMT -5
If you do what George says, you have to be sure that you use it as a line command. That is, if the profile name was COB, you'd have to enter .COB as an FM line command and press ENTER. You CAN'T put .COB in the line command area and then CLICK on the file name. If you do, the .COB thing will be ignored.
I didn't know that myself until I just tried it. Seems like it should have picked up the .COB field, but it's doesn't right now.
|
|