WS-FIRST-LINE S 01 A VALUE 'Y'
WS-FIRST-LINE W 01 A VALUE 'Y'
can anyone point out the difference between these 2 declarations?
Difference between W and S?
Re: Difference between W and S?
I'm not really sure either, but here's what the manual says about Working Storage FieldsTRESA wrote:can anyone point out the difference between these 2 declarations?
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: Difference between W and S?
TRESA wrote:WS-FIRST-LINE S 01 A VALUE 'Y'
WS-FIRST-LINE W 01 A VALUE 'Y'
can anyone point out the difference between these 2 declarations?
Both define "working storage fields". When a "W" field is referenced in a report, its value is that which it had at the time of the PRINT statement to produce the report. The value of an "S" field is resolved at the time that the report is formatted for printing. Can cause confusions and differences.
I suggest using a different prefix for the two different types (I cunningly use "W-" and "S-"). I make a rule of thumb, never to amend a "W" field in a report procedure, never to use an "S" field in a report without amending it in a report procedure.