Discussion:
ASA when using cobol
(too old to reply)
diesmo
2004-09-26 21:48:51 UTC
Permalink
Hello!

I found this sentence in a cobol program:
SELECT file1 ASSIGN TO file2 ASA.

ASA means, i think, that the file uses the ASA records delimiter.

Is this keyword and syntax construction part of
- 1) the cobol standard syntax,
- 2) or part of a specific dialect (only MFocus for example ?),
- 3) or is it not cobol (Pro*COBOL ? ), and the file has to be
preprocessed : the compiler should just remember that the file uses
ASA ?

Are there any other "ASA"-like constructions ?
If someone knows a link with documentation on these aspects of using
Files in Cobol...

Thank you!

Regards,
diesmo.
William M. Klein
2004-09-26 22:16:17 UTC
Permalink
All the compilers (that I know about) use the 2nd thru Nth word after the ASSIGN
TO as "documentary only". For IBM mainframe compilers the ADV / NOADV compiler
option determines whether the ASA "carriage control character" is used (and
whether or not it is implicit/explicit in the FD record size). I believe that
Micro Focus "Mainframe Express" also supports this compiler option (directive) -
but don't know about NetExpress.

What exactly are you trying to do? Are you trying to convert a (IBM) mainframe
program to Micro Focus environment? Are you maintaining an existing program in
the same environment? Something else?
--
Bill Klein
wmklein <at> ix.netcom.com
Post by diesmo
Hello!
SELECT file1 ASSIGN TO file2 ASA.
ASA means, i think, that the file uses the ASA records delimiter.
Is this keyword and syntax construction part of
- 1) the cobol standard syntax,
- 2) or part of a specific dialect (only MFocus for example ?),
- 3) or is it not cobol (Pro*COBOL ? ), and the file has to be
preprocessed : the compiler should just remember that the file uses
ASA ?
Are there any other "ASA"-like constructions ?
If someone knows a link with documentation on these aspects of using
Files in Cobol...
Thank you!
Regards,
diesmo.
Robert Wagner
2004-09-27 01:15:18 UTC
Permalink
Post by diesmo
Hello!
SELECT file1 ASSIGN TO file2 ASA.
ASA means, i think, that the file uses the ASA records delimiter.
Is this keyword and syntax construction part of
- 1) the cobol standard syntax,
- 2) or part of a specific dialect (only MFocus for example ?),
- 3) or is it not cobol (Pro*COBOL ? ), and the file has to be
preprocessed : the compiler should just remember that the file uses
ASA ?
Are there any other "ASA"-like constructions ?
If someone knows a link with documentation on these aspects of using
Files in Cobol...
Since you mentioned Micro Focus and Pro*Cobol, it sounds like you're
on a server or PC. ASA is a mainframe format, not supported on other
platforms. Try replacing ASA with ORGANIZATION IS LINE SEQUENTIAL.

Format of flat files is not determined by Cobol, it is determined by
the operating system and its tools such as sort and print spooler.
That's why people have repeatedly asked what platform you are using.
If you would answer, someone could help you without guessing.
Robert Wagner
2004-09-27 02:20:08 UTC
Permalink
Post by diesmo
Hello!
SELECT file1 ASSIGN TO file2 ASA.
ASA means, i think, that the file uses the ASA records delimiter.
Is this keyword and syntax construction part of
- 1) the cobol standard syntax,
- 2) or part of a specific dialect (only MFocus for example ?),
- 3) or is it not cobol (Pro*COBOL ? ), and the file has to be
preprocessed : the compiler should just remember that the file uses
ASA ?
Whoops. I thought you were sameer, who is wrestling with a similar
flat file problem. Now I see you're the 'Java parsing guy'. I
apologize for the misunderstanding.

ASA means records are delimited (prelimited?) by a leading space. It's
not standard Cobol nor supported by Micro Focus.
Post by diesmo
Are there any other "ASA"-like constructions ?
If someone knows a link with documentation on these aspects of using
Files in Cobol...
I doubt there are. More likely exceptions are in ORGANIZATION IS.
diesmo
2004-09-27 13:29:21 UTC
Permalink
Hello!

In fact i am trying to understand (learn) the COBOL language, so i
read all the documentation i can find on the net, i downloaded a lot
of program samples, i have RM/COBOL Compiler 74 and 85, MSCOBOL,
COBOL650, Fujitsu COBOL, cobcy, and TinyCobol to test these programs.

The construction
"SELECT internalFD1 ASSIGN to externalFD1 ASA."
does not compile with the compilers listed above.

As you said, the "ASA" is for documentation only, but the syntax is
parsed by the compiler.

"ASA" (QSAM) is documented here :
www.cs.niu.edu/~abyrnes/csci465/notes/465qsam.htm
As you said, ASA format uses a carriage control to prefix every
RECORD.

if i understood well, to describe sequential files, either
- the records have the same length :
==> RECORD CONTAINS 12 CHARACTERS ,
- or the records are delimited by a special character (";" for
example)
==> RECORD DELIMITER IS ; . (???)
- or the records are delimited by a "system" carriage control :
Machine or ASA carriage control (MCC or ASA).
==> RECORD DELIMITER IS STANDARD-1 (???)

it seems that the sentence above is equivalent to something like :
SELECT internalFD1 ASSIGN to externalFD1
ORGANIZATION IS SEQUENTIAL (the default one...)
RECORD DELIMITER IS SPACE.
Is it ?
(In fact the only construct i've found is : "RECORD DELIMITER IS
STANDARD-1").

I'll try to find other compilers to test this program (MF, IBM,
COMPAQ), but i think that none will accept it, or as you said, only
with a special directive.

The Program mention :
"SOURCE-COMPUTER. LEVEL-64"

I think it is MicroFocus, but i do not have the compile options.

Thank you!

Regards,
diesmo.
Robert Wagner
2004-09-27 16:42:06 UTC
Permalink
Post by diesmo
Hello!
In fact i am trying to understand (learn) the COBOL language, so i
read all the documentation i can find on the net, i downloaded a lot
of program samples, i have RM/COBOL Compiler 74 and 85, MSCOBOL,
COBOL650, Fujitsu COBOL, cobcy, and TinyCobol to test these programs.
Cobol is a big languge. A beginner has trouble distinguishing the
basic essentials from features that are obsolete, seldom used and
platform specific.

You might consider reading Thane Hubbell's "Teach Yourself Cobol in 24
Hours". Or read my Best Practices, a 30 page paper posted to this
newsgroup. It contains features you really need to know while omitting
unessential ones.
Post by diesmo
The construction
"SELECT internalFD1 ASSIGN to externalFD1 ASA."
does not compile with the compilers listed above.
As you said, the "ASA" is for documentation only, but the syntax is
parsed by the compiler.
www.cs.niu.edu/~abyrnes/csci465/notes/465qsam.htm
As you said, ASA format uses a carriage control to prefix every
RECORD.
ASA is for IBM mainframes. It sounds like you're in the PC world, so
don't worry about it. Line printers are obsolete anyway.
Post by diesmo
if i understood well, to describe sequential files, either
==> RECORD CONTAINS 12 CHARACTERS ,
- or the records are delimited by a special character (";" for
example)
==> RECORD DELIMITER IS ; . (???)
Machine or ASA carriage control (MCC or ASA).
==> RECORD DELIMITER IS STANDARD-1 (???)
SELECT internalFD1 ASSIGN to externalFD1
ORGANIZATION IS SEQUENTIAL (the default one...)
RECORD DELIMITER IS SPACE.
Is it ?
(In fact the only construct i've found is : "RECORD DELIMITER IS
STANDARD-1").
The format for fixed-length sequential is not as simple as it appears.
Some compilers expect a proprietary format known only to that
compiler. It may have a file header and/or something in front of each
record. Avoid this format.

On PC, the universal standard for flat files is records delimited by
cr/lf. On most compilers you specify that with:
ORGANIZATION IS LINE SEQUENTIAL
Post by diesmo
I'll try to find other compilers to test this program (MF, IBM,
COMPAQ), but i think that none will accept it, or as you said, only
with a special directive.
"SOURCE-COMPUTER. LEVEL-64"
I think it is MicroFocus, but i do not have the compile options.
Level-64 was a Honeywell/Bull mainframe in the 70's. Generally,
source- and object-computer are for documentation only.

Don't spend much time on identification and environment divisions. The
meat and potatoes of Cobol is in the data and procedure divisions.
Lueko Willms
2004-09-27 07:14:00 UTC
Permalink
. Am 26.09.04
schrieb ***@caramail.com (diesmo)
auf /COMP/LANG/COBOL
in ***@posting.google.com
ueber ASA when using cobol

p> I found this sentence in a cobol program:
p> SELECT file1 ASSIGN TO file2 ASA.
p>
p> ASA means, i think, that the file uses the ASA records delimiter.
p>
p> Is this keyword and syntax construction part of
p> - 1) the cobol standard syntax,
p> - 2) or part of a specific dialect (only MFocus for example ?),

Both, since the standard formulation is

SELECT file-name ASSIGN TO { implementor-name-1 | literal-1 }...

i.e. to what the file is assigned to, is the matter of the
implementor of a COBOL compiler, and there can be more than one item
there.

p> Are there any other "ASA"-like constructions ?

Sure, the standard allows this.

E.g. on Unisys' OS/2200, there also two implementor-name-1, the
first one would be TAPE or DISC, and the second name the name by which
the file is known in that run-stream.

So you would have to consult your compilers manual to find out what
this combination "file2 ASA" means.

BTW, ASA reminds me of "American Standards Associacion", but it is
probably a MUM (Multi-Use Mnemonic).


Yours,
Lüko Willms http://www.mlwerke.de
/--------- ***@jpberlin.de -- Alle Rechte vorbehalten --

"Ohne Pressefreiheit, Vereins- und Versammlungsrecht ist keine
Arbeiterbewegung möglich" - Friedrich Engels (Februar 1865)
Loading...