Page 1 of 1

What is ? in reformat fields?

Posted: Thu Aug 04, 2022 12:29 pm
by Chaitnaya
Hi guys,

What is ? in reformat fields?

Re: What is ? in reformat fields?

Posted: Fri Aug 05, 2022 1:51 pm
by Anuj Dhawan
You might want to give an example of your specific situation. An educated guess is that you are talking about REFORMAT used in JOINKEYs, are you? Please elaborate.

Re: What is ? in reformat fields?

Posted: Sat Aug 06, 2022 9:41 am
by Chaitnaya
Hi Anuj,

Thank you for your reply.

Yes, I am talking about the REFORMAT in JOINKEYs like below:

reformat fields.jpeg

Re: What is ? in reformat fields?

Posted: Mon Aug 08, 2022 9:02 pm
by Anuj Dhawan
? indicates a 1-byte indicator is to be included in each joined record. The indicator will be set to one of the following values in each paired or unpaired joined record, as appropriate:

'B' - the key was found in F1 and F2.
'1' - the key was found in F1, but not in F2.
'2' - the key was found in F2, but not in F1.

Only one ? can be specified in the FIELDS operand. If ? is not the last item, it must be followed by F1: or F2:.

For TYPE=F joined records, the indicator can appear anywhere in the record. For example, each of the following is valid:

Code: Select all

* Put indicator in position 1 of each joined record.
  REFORMAT FIELDS=(?,F1:1,20,F2:5,8)

* Put indicator in position 21 of each joined record.
  REFORMAT FIELDS=(F1:1,20,?,F1:31,9)

* Put indicator in position 25 of each joined record.
  REFORMAT FIELDS=(F2:11,20,6,4,?)
For TYPE=V joined records, the indicator must appear in the fixed part of the record, that is, after the RDW and before the position without length fields. For example, the following is valid:

Code: Select all

* Put indicator in position 5 of each joined record. 
  REFORMAT FIELDS=(F1:1,4,?,F1:11)
See this link for details: https://www.ibm.com/docs/en/zos/2.1.0?t ... -statement

Re: What is ? in reformat fields?

Posted: Sun Aug 14, 2022 12:28 pm
by Chaitnaya
Anuj Dhawan wrote: Mon Aug 08, 2022 9:02 pm ? indicates a 1-byte indicator is to be included in each joined record. The indicator will be set to one of the following values in each paired or unpaired joined record, as appropriate:

'B' - the key was found in F1 and F2.
'1' - the key was found in F1, but not in F2.
'2' - the key was found in F2, but not in F1.

Only one ? can be specified in the FIELDS operand. If ? is not the last item, it must be followed by F1: or F2:.

For TYPE=F joined records, the indicator can appear anywhere in the record. For example, each of the following is valid:

Code: Select all

* Put indicator in position 1 of each joined record.
  REFORMAT FIELDS=(?,F1:1,20,F2:5,8)

* Put indicator in position 21 of each joined record.
  REFORMAT FIELDS=(F1:1,20,?,F1:31,9)

* Put indicator in position 25 of each joined record.
  REFORMAT FIELDS=(F2:11,20,6,4,?)
For TYPE=V joined records, the indicator must appear in the fixed part of the record, that is, after the RDW and before the position without length fields. For example, the following is valid:

Code: Select all

* Put indicator in position 5 of each joined record. 
  REFORMAT FIELDS=(F1:1,4,?,F1:11)
See this link for details: https://www.ibm.com/docs/en/zos/2.1.0?t ... -statement
Thank you so much Anuj. This is really helpful.