We will generate XML statement from input records having fixed positions using SORT. We will use REMOVECC, HEADER1, BUILD, JFY, SHIFT, LEFT, LEAD, TRAIL, LENGTH, SQZ & TRAILER1 parameters.
REMOVECC: The REMOVECC parameter generates reports that do not include ANSI carriage control characters that specify printer actions (for example, skipping a line or ejecting a page).
HEADER1: HEADER1 provides a header or a possible title page for the entire report. It appears only once at the beginning of the report on its own page.
BUILD: BUILD is an alias for OUTREC. This parameter lets you create multiple output files & indicates how the records are to be formatted in each output file.
JFY: The JFY sub-parameter specifies that an input field be processed for left-justification or right-justification for the output record.
SHIFT: Specifies the justification SHIFT=LEFT indicates that you want to left-justify SHIFT=RIGHT indicates that you want to right-justify.
LEFT: Specifies left-justification of the input field. Leading blank characters are eliminated; all remaining characters are shifted left.
LEAD: LEAD=string specifies the leading string as a character or hexadecimal constant (1 to 50 bytes).
TRAIL: TRAIL=string specifies the trailing string as a character or hexadecimal constant.
LENGTH: LENGTH sub-parameter to alter the length of the output field.
SQZ: The squeeze feature is used to replace groups of blanks between the first nonblank and last nonblank with other characters.
TRAILER1: It provides a trailer or a possible summary for the entire report. It appears only once at the end of the report on its own page.
This is a 80-byte FB input file containing below mentioned records.
Input Data:
Artificial Intelligence Norman JR
Robotics Steve O
Hacking Adam G
SYSIN Data:
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(C'<?xml version="1.0"?>',/,
3:C'<Expertise>'),
BUILD=(5:C'<Specialization>',/,
7:1,20,JFY=(SHIFT=LEFT,LEAD=C'<subject>',TRAIL=C'</subject>',
LENGTH=36),/,
7:24,15,SQZ=(SHIFT=LEFT,LEAD=C'<author>',MID=C', ',
TRAIL=C’</author>',LENGTH=33),/
5:C'</Specialization>'),
TRAILER1=(3:C'</Expertise>')
OUTPUT XML statements:
<?xml version="1.0"?>
<Expertise>
<Specialization>
<subject>Artificial Intelligence </subject>
<author>Norman, JR</author>
</Specialization>
<Specialization>
<subject>Robotics</subject>
<author>Chatterjee, O</author>
</Specialization>
<Specialization>
<subject>Hacking</subject>
<author>Adam, G</author>
</Specialization>
</Expertise>
OUTFIL HEADER1 used to generate the xml and Expertise starting tags that precede the set of tags for each record. OUTFIL BUILD is used to generate the set of tags for each record as given below:
OUTFIL TRAILER1 is used to generate the Expertise ending tag that follows the set of tags for each record.
Effective User interviews play a crucial role in Scrum methodology, helping Product Owners and Scrum…
Product Owners should be well-versed in various user research tools and techniques to effectively understand…
Effective Product Owner plays a crucial role in Agile development, acting as the bridge between…
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…