Sublime Forum

Is this kind of snippet possible?

#1

Hello everyone.
I’am a ACUCOBOL-GT programmer (junior :frowning:) and iam thinking about a plugin to help me and my coworkers, but i don’t know is this is possible and have no idea how to do, so this is the point:

Cobol is divided into 4 divisions, and each division can have some sections.
This is the divisions:
identification division.
environment division.
data division.
procedure division.

I use too much file copy’s into every program, like 30+
The process of copying, declaring file-status, opening and closing the file took a lot of time, when i need to do 30 or 50 or even 100 times into a single program, so iam thinking if is it possible to automate this process.

I can use some sections/procesures as marks, because the copy, file-status, open and close have to be made into the same “spot” into all programs, like:

selects(archive.sl) copy’s go after the file-control:

file-control.

copy my-archive.sl.

file descriptions(archive.fd) go after the file selection:
file selection.

copy my-archive.fd.

file status go after working-storage section:

working-storage section.

01 fs-my-archive pic x(02) value spaces.
88 valid-my-archive value “00” thru “09”.

open command go after the procedure division:

procedure division.

open input my-archive.
if not ca-stat-ok
move “my-archive” to ca-err-file
perform mostra-erro-abertura
go rot-fim
end-if.

And the close command go into the rot-fim paragraph:

rot-fim.
close my-archive.

Is it possible to create something (a snippet?) that triggers when i copy some archive, to do all the other things into the correct places using the sections/procedures/paragraphs as marks?

If anyone can give me a helping hand to start, I thank you.

ps: sorry for my horrible english knowledge.

Thanks everyone.

0 Likes

#2

I did it using an external program (Macro Expert). It’s working well, but i still miss this at sublime itself.

1 Like