INREC BUILD=(C'C1,''',50C'A',C'''',80:X) .
Why are there 3 single quotes after C1 and 4 quotes after 50C'A'. What do they represent .When using C'string' you need two apostrophes for each apostrophe in the string.
C'C1,''' = C1,'
50C'A' = A...A
C'''' = '
So the string is C1,'A...A' - this creates a symbol named C1 for A...A (50 A's).
Frank i am not clear on this syntax (C'C1,''',50C'A',C'''',80:X).
C'''' that appears in INREC is explained as 1 apostrophe(') in your explanation given above. My doubt is , why is it written as ,C'''', and why not as ,'''', because in C1,' the apostrophe after C1, is represented as ''' not as C'''. On submitting the JCL with '''' it throws syntax error .
, but it works fine with C'''' . Please explain why is it so.
Could you please throw more light on this.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
C'string' defines a constant string constant. The string must be preceded by C' and followed by '. To define an apostrophe in a string, you must use two apostrophes.
C'''' is C'string' where string is '' (an apostrophe represented by two apostrophes). '''' is invalid because it is not preceded by C.
C'C1,''' is C'string' where string is C1,'' (C1, and an apostrophe represented by two apostrophes).
I don't know how to explain it better than that.
If the apostrophe characters confuse you, then perhaps this equivalent version of the INREC statement using X'7D' for the apostrophe will be easier to understand: