We can get the dynamic header in e-text:
Example:
If we need a SYSDATE as header and the person numbers are values for that header.
create a data model with two data sets :
1. Sysdate : SELECT SYSDATE FROM DUAL
2. PersonNumbers : select person_number from per_all_people_f
The XML file for the above data sets will generate like below:
<?xml version = '1.0' encoding = 'utf-8'?>
<DATA_DS>
<G_1>
<SYSDATE>2019-03-04T06:20:02.000+00:00</SYSDATE>
</G_1>
<G_2>
<PERSON_NUMBER>5678</PERSON_NUMBER>
</G_2>
<G_2>
<PERSON_NUMBER>7799</PERSON_NUMBER>
</G_2>
<G_2>
<PERSON_NUMBER>7769</PERSON_NUMBER>
</G_2>
<G_2>
<PERSON_NUMBER>3557</PERSON_NUMBER>
</G_2>
<G_2>
<PERSON_NUMBER>6436</PERSON_NUMBER>
</G_2>
</DATA_DS>
create a e-text like below:
Format Setup:
<TEMPLATE
TYPE>
|
DELIMITER_BASED
|
<OUTPUT CHARACTER SET>
|
UTF-8
|
<NEW RECORD CHARACTER>
|
Carriage Return
|
Format Data Records:
<LEVEL>
|
DATA_DS
|
<LEVEL>
|
G_1
|
<MAXIMUM LENGTH>
|
<FORMAT>
|
<PAD>
|
<DATA>
|
<COMMENTS>
|
<NEW RECORD>
|
Line
|
|||
1000000
|
ALPHA
|
TO_CHAR(SYSDATE,’YYMMDD’)
|
SYSDATE
|
<END
LEVEL>
|
G_1
|
<LEVEL>
|
G_2
|
<MAXIMUM LENGTH>
|
<FORMAT>
|
<PAD>
|
<DATA>
|
<COMMENTS>
|
<NEW RECORD>
|
Line
|
|||
1000000
|
ALPHA
|
PERSON_NUMBER
|
PERSON_NUMBER
|
<END
LEVEL>
|
G_2
|
<END
LEVEL>
|
DATA_DS
|
190304
5678
7799
7769
3557
6436
Thanks,
Sainath
No comments:
Post a Comment