|
Post by mg34dan on Jun 28, 2017 5:03:45 GMT -5
I would like to create pattern jobs streams for common utility functions rather than surrounding each and every source member with JCL. An example would be a JOB used to place macros into an MVS MACLIB. For example, by changing every occurrence of string 'XXXXXXXX' to the name of an actual directory member I could add any/all members to SYS2.MACLIB with only one JCL pattern job stream:
//XXXXXXXX JOB (1),'IBM USER',CLASS=A,MSGCLASS=K,REGION=4096K, // USER=IBMUSER,PASSWORD=IBMUSER //* //* JOB TO LOAD MACROS INTO SYS2.MACLIB //* //IEBUPDTE EXEC PGM=IEBUPDTE,PARM=NEW //SYSPRINT DD SYSOUT=* //SYSUT2 DD DISP=SHR,DSN=SYS2.MACLIB //SYSIN DD * ./ ADD NAME=XXXXXXXX #INCLUDE "XXXXXXXX" <- ACTUAL SOURCE MEMBER NAME HERE ./ ENDUP /* //
|
|
|
Post by George on Jun 28, 2017 13:27:32 GMT -5
There are two places where this could be accomplished:
First: Right in SPFLite if it was acceptable to reserve a special string like #INCLUDE to specify the name of a local filename to be included.
Second: To create a small file copy utility which would do the insertion as it copied a file. Then the SUBMIT model command could invoke a small BAT file to copy the file and do the insertion and then pass the new file to the SPFSUBMIT program for copying to the internal reader.
The first is cleanest and simplest, the only negative is the arbitrary choice of #INCLUDE, although I don't see that as a major negative.
The second is also simple, the choice of 'trigger word' can be unique to each individual if desired, but is slightly messier to implement.
If no-one has another simple idea, I'll have a look at adding this internally.
George
|
|
|
Post by George on Jun 30, 2017 13:21:11 GMT -5
Robert: Indeed - SPFSubmit is the proper place to do all this stuff. As this is your piece of code, I leave it in your capable hands to make the change. When you have a newer version of SPFSubmit created, we can simply include it in the next release distribution.
George
|
|
|
Post by mg34dan on Jul 1, 2017 6:21:17 GMT -5
Geeze guys, we may be over thinking/engineering this. Simple is always best, in my experience. In my example above I used '#INCLUDE' as the keyword. Its use was completely arbitrary. Any unique keyword can be used; @@insert, %FETCH, ^^GRABIT, etc. Since this would be a new facility, enforce simple basic rules. If the name of the file to be included is surrounded by single quotes, ('), it is in the current directory. If the name of the file is surrounded by double quotes, ("), it is a fully qualified file name. No other file name options would be allowed. The 'include' keyword is not user specified, the keyword always starts in column 1, and only one file is to be 'included' per statement. There is no nesting of 'included' files.
|
|
|
Post by George on Jul 1, 2017 11:01:57 GMT -5
I agree with the KISS philosophy, if we do it with a fixed #INCLUDE line then this becomes a trivial change to the SUBMIT command, probably one paragraph of code. The remainder of the #INCLUDE line is the filename, either a simple name or a full pathname (quoted or unquoted, single or double quotes) If not a full pathname, the file must be in the same folder as the current edit file. I seriously doubt the need for a column operand, only COBOL might need this, and even then, the #INCLUDE in col 1 works since I can't picture people maintaining sequence numbers in Cols 1-6 anymore.
Even if we did go Robert's route, it wouldn't NEED any changes to the SPFLite code, as everything is passed to SPFSUBMIT as operands, and these new operands could simply be added, if needed, to the existing command string. Although expanding the input text box so the whole string was visible wouldn't hurt.
My vote is the simple, fixed #INCLUDE method.
George
|
|
|
Post by mg34dan on Jul 1, 2017 14:47:16 GMT -5
Off hand, I can only think of one area where an error could occur. That would be if the base 'submitted' file and the 'included' file had differing end-of-line terminators, e.g. CR vs CRLF vs LF vs ?. I guess we could also have a problem if both files are not of the same code page too.
|
|
|
Post by George on Jul 1, 2017 15:16:58 GMT -5
msg34dan: Hmm, yes, overlooked that. Handling differing file characteristics would make this considerably more difficult. The read routines which handle all conversion are designed ONLY to read and add lines to the edit file. They'd need to be altered to allow just simple reading of a file. I think right now I'd just do the basic simple version, and make the full version a longer term change.
I think it also means it has to be done within SPFLite and not in the SPFSubmit program as proper reading needs access to the file's profiles and associated SOURCE tables, none of which SPFSubmit currently cares about.
I'll do the simple version right now and then revise it to do the full version afterward.
George
|
|
|
Post by George on Jul 2, 2017 14:11:42 GMT -5
msg34dan: OK, I managed to do the full version and have a test version if you'd like to try it. Just send me a private message with your email address. Just do an OPTIONS => SUBMIT first to set the trigger values for the #INCLUDE statement.
George
|
|
|
Post by mg34dan on Jul 2, 2017 15:02:57 GMT -5
PM just sent.
|
|
|
Post by mg34dan on Jul 3, 2017 14:37:04 GMT -5
George; Thank you for your efforts. All seems to be working quite well. I had no issues with the SPFLite code, but Windows 10 can be a pain in the posterior at times.
|
|
|
Post by George on Jul 3, 2017 15:45:36 GMT -5
mg34dan: Yes Win 10 is peculiar. First thing I did was install Classic Shell - to get a normal old-style Start button back. And 8GadgetPack to get back desktop gadgets (you know, those security exposures MS is saving us from). Now Win10 looks and acts just like good old Win 7.
Actually, the thing I would miss most if it stopped functioning is True Launch Bar, which is a super product.
Glad the Include changes worked OK.
|
|
|
Post by mg34dan on Jul 9, 2017 7:14:35 GMT -5
George; This new facility has saved me a considerable amount of work. I was able to upload 175 macros and 285 COBOL COPY BOOKS using only two JOB streams. That sure beats wrapping all those members with JCL. Thanks again.
|
|
|
Post by George on Jul 10, 2017 15:31:06 GMT -5
Dan: Thanks, it's always nice to hear that stuff we work on makes someone's life a bit easier. And sometimes it's small changes like this that have as much or more impact as the major enhancement stuff.
I guess that means I really should roll out a new release.
George
|
|
|
Post by mg34dan on Jul 14, 2017 8:40:55 GMT -5
For those using the #INCLUDE facility, here is a little productivity tip: Use the WINDOWS/DOS 'SUBST' command to assign a drive letter to your source directory and keep your JOB streams in their own directory. For example, here is a sample JOB stream used to place a COBOL COPY BOOK into an MVS COPYLIB:
//XXXXXXXX JOB (1),'IBM USER',CLASS=A,MSGCLASS=K,REGION=4096K, // USER=IBMUSER,PASSWORD=IBMUSER,MSGLEVEL=(1,1) /*JOBPARM ROOM=IBM //* //* JOB TO LOAD COBOL COPY BOOKS INTO SYS2.COPYLIB //* //* //* TO MAP Q: DRIVE //* SUBST Q: "Z:\WINTOOLS\HERCULES\MVS\PROJECT 6\COPYLIB" //* //* TO RELEASE Q: DRIVE //* SUBST Q: /D //* //* //IEBUPDTE EXEC PGM=IEBUPDTE,PARM=NEW //SYSPRINT DD SYSOUT=* //SYSUT2 DD DISP=SHR,DSN=SYS2.COPYLIB //SYSIN DD * ./ ADD NAME=XXXXXXXX #INCLUDE Q:\XXXXXXXX ./ ENDUP /* //
By using the SUBST command and keeping the JCL isolated, you only need to maintain a single JOB stream per function. This keeps your JOB streams isolated which makes their maintenance so much easier. Plus, there is no need to fully qualify a directory for your #INCLUDE source members. Your JOB stream remains clean and simple. All one need do to submit three COPY BOOKS to process is to do the following:
A) In a Command Prompt Window enter the following command: SUBST Q: "Z:\WINTOOLS\HERCULES\MVS\PROJECT 6\COPYLIB"
C) Edit the JCL member with SPFLite and issue the following commands in sequence: C XXXXXXXX COPY1 ALL SUB UNDO C XXXXXXXX COPY2 ALL SUB UNDO C XXXXXXXX COPY3 ALL SUB UNDO
Optionally, if you wish to remove the Q: drive, issue the following in a Command Prompt Window: SUBST Q: /D
|
|
|
Post by George on Jul 14, 2017 14:02:34 GMT -5
Robert: Did you delete your post with your full proposal? If so, why on earth?
And what about a simple macro to avoid repetitive typing, after all that's one reason we put macros in. Not every repetitive task needs to be solved by bolting on more code complexity. A simple macro like
' SUBONE.macro if Get_Arg$(1) = "" then halt(fail, "Missing macro operand") SPF_Cmd("CHANGE XXXXXXXX ALL " + Get_Arg$(1)) SPF_Cmd("SUBMIT") SPF_Cmd("CHANGE " + Get_Arg$(1) + " XXXXXXXX ALL") halt("SUBMIT Completed")
accomplishes the same thing. (Have to avoid UNDO - not allowed in Macros.)
As to false positives. Since the trigger string and location are user specified, I'd find it hard to believe a user would choose anything which would appear in any of the data they are manipulating.
George
|
|