Difference between W and S?

Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool
TRESA
Posts: 8
Joined: Sun Oct 28, 2007 11:51 am
Skillset: cobol,jcl,easytrieve,cics,db2
Referer: colleauge

Difference between W and S?

Postby TRESA » Sat Nov 03, 2007 12:47 pm

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?

CICS Guy
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am

Re: Difference between W and S?

Postby CICS Guy » Sat Nov 03, 2007 1:24 pm

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

BillyBoyo
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?

Postby BillyBoyo » Sat Jan 29, 2011 5:57 pm

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.