chaat
Sophomore Member
Posts: 59
|
Post by chaat on Sept 15, 2014 16:54:17 GMT -5
I'm wondering if there is a way to have SPFLITE pad lines with spaces within the editor but then strip the trailing blanks when writing out the edited file.
for example all of my source code files have the trailing blanks removed to save space. however when i'm editing the them, i have need to find the first position after the end of the line. this is an issue that i'm trying to resolve.
any help / suggestions would be appreciated.
Chuck H.
|
|
chaat
Sophomore Member
Posts: 59
|
Post by chaat on Sept 16, 2014 10:39:33 GMT -5
i write code for the mainframe on my pc. that code has db2 and cics commands. I don't have either of those on my pc, so i wrote 2 small pre and post processor programs. they comment out / uncomment the source lines which have EXEC SQL / EXEC CICS commands. The Fujitsu compiler that i use automatically trims trailing spaces for the output file which is defined a line sequential in the pre/post processor programs.
when editing the output from the preprocessor, I'm attempting to add a period to the end of all the lines in a paragraph with the following two commands. I've set labels to delimit the paragraph.
c p'^ ' p'=!' 44 71 all .a .b ===> this adds a "!" to the end of the lines
c '!' '.' all .a .b ===> this changes the "!" to a period
the first command does not find any trailing spaces due to the "trimming" of the source code by the preprocessor that i use.
so the issue is not about the line lengths, the source code being edited is variable length with NO trailing spaces.
|
|
chaat
Sophomore Member
Posts: 59
|
Post by chaat on Sept 16, 2014 12:28:32 GMT -5
Thanks Robert, the APPEND sounds like exactly what i'm looking for. Also I found the MINLEN in the file profile section.
I've been holding off converting from using SPF/SE which I've purchased. After I get my command setup to invoke the compiler for the file which is being edited, i think that i'll give spflite another go. it has some nice features.
I'm still looking for the suggestions on VSAVE automation to move towards implementation.
|
|
chaat
Sophomore Member
Posts: 59
|
Post by chaat on Sept 21, 2014 16:07:48 GMT -5
Robert, I used the MINLEN setting along with PRESERVE NO to get all the lines in the file to have blanks at the end. It works very well for being able to do a FIND P'^ ' to find the last character on a line.
However when using the APPEND command to try to add a "." after the last character in the line, it's added at position 73 (I used MINLEN 72).
Is there a way to get APPEND to position after the last non-blank position on the lines rather than the last position on the line ?
I tried to do a TR 8 line command before entering the APPEND command. It did not make any difference. I suspect that the MINLEN 72 is overriding the TRIM line command.
As for the VSAVE, I would like to have something like RECOVERY ON in ISPF. Doing a SAVE / VSAVE after every ENTER would be expensive. As a compromise I was thinking of have an option where a VSAVE command would be entered after every n number of ENTER's have been processed.
When I'm deep in coding mode, i usually forget to do interim SAVE commands.
It's unbelievably frustrating to have been coding for an hour or more and then have the editor or your windows os crash only to realize all of your work in lost.
|
|
|
Post by George on Sept 22, 2014 11:52:22 GMT -5
chaat: This looks more like you have to decide just what format you want the file written in. If you really need trailing blanks just to pad to a fixed LRECL, then I think the simplest action is just to describe the file as RECFM=F LRECL=80/72/whatever.
You should not need MINLEN to do the padding, the lines will be padded when they are written.
MINLEN=0 also means APPEND will work properly.
And since introducing the Picture characters [ ] { } there should be no problem locating strings at the beginning/end of lines.
IMHO using MINLEN and PRESERVE YES etc. to force blank padded lines causes more problems than its worth.
George
|
|