Page 1 of 1

Difference between W and S?

PostPosted: Sat Nov 03, 2007 12:47 pm
by TRESA
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?

Re: Difference between W and S?

PostPosted: Sat Nov 03, 2007 1:24 pm
by CICS Guy
TRESA wrote:can anyone point out the difference between these 2 declarations?
I'm not really sure either, but here's what the manual says about Working Storage Fields

Re: Difference between W and S?

PostPosted: Sat Jan 29, 2011 5:57 pm
by BillyBoyo
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.