View previous topic :: View next topic
|
Author |
Message |
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Whats wrong with Linkage Section for a program that reads a file!? |
considering the competence of the poster,
obviously confusing and an unnecessary complication
plus, why use linkage? not a good habit.
it is the same as using the FD for a file record.
though in the case of CICS,
i believe CICS issues a GETMAIN for the structure
and moves the data to the newly acquired storage
and must set a POINTER.
a lot of overhead to save 80 bytes in working-storage.
have to use working-storage for a rewrite if length is changed anyway.
if there is a problem, the dump also has to include the GETMAINed storage
else you don't have the record
whereas if it is in working-storage,
there is a chance that it can be found.
it may be your habit,
but i do not consider it good programming practice. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
I haven't coded for a while, but I'd like to throw this into the mix as a possibility and DBZ may not like this.
Define an 01 area in LINKAGE (length of 256 to be safe), define a WS halfword-length and set it to ZERO.
Issue the READ with a SET(ADDRESS OF 01 LINKAGE AREA) and the actual record-length will be set in the halfword.
Move the 01 LINKAGE area to the 01 WORKING-STORAGE area, using reference modification, based upon the halfword-length.
Then, calculate the ODO based upon the halfword-length. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
as a final thought,
Peter,
the only reason we are having this discussion
(and yes,
in CICS modules
I occasionally use linkage and do getmains
but still consider it poor programming practice,
because it takes a competent person to follow me
when I code that way)
is because the TS is a poorly trained, inexperienced COBOL programmer. |
|
Back to top |
|
|
|