Hi,
we are writing this fields dynamically retrieved from database and writing
into the file.
$bmpRec = $bmpRec.'|'.$cust_id; \# sp4
$bmpRec = $bmpRec.'|'.$serv_id; \# sp5
$bmpRec = $bmpRec.'|'.$site_id; \# sp6
$bmpRec = $bmpRec.'|'.$loc_id; \# sp7
$bmpRec = $bmpRec.'|'.substr\($si_room, 0, 25\); \# sp8
$bmpRec = $bmpRec.'|'.substr\($floor, 0, 9\); \# sp9
$bmpRec = $bmpRec.'|'.substr\($sof_id, 0, 20\); \# sp10
$bmpRec = $bmpRec.'|'.substr\($cc\_case_num, 0, 10\); \# sp11
$bmpRec = $bmpRec.'|'.substr\($cc\_part_num, 0, 30\); \# sp12
$bmpRec = $bmpRec.'|'. ""; \# sp13, \(cc\_site_id\) 01d removed from db
$bmpRec = $bmpRec.'|'.substr\($acc_type, 0, 20\); \# sp14
$bmpRec = $bmpRec.'|'.$speed_value; \# sp15
$bmpRec = $bmpRec.'|'.substr\($link_protocol, 0, 10\); \# sp16
$bmpRec = $bmpRec.'|'.$site\_glbl_dlci; \# sp17
$bmpRec = $bmpRec.'|'.$intnl\_gw_popid; \# sp18
$bmpRec = $bmpRec.'|'.substr\($fr_encapsulation, 0, 10\); \# sp19
$bmpRec = $bmpRec.'|'.substr\($csu_dsu, 0, 25\); \# sp20
$bmpRec = $bmpRec.'|'. ""; \# sp21 \(lpw\)
Finally we are printing the $bmpRec to a file
printf OUT "$bmpRec|\\n"
When we are printing this variable into the file it has printed upto
I # sp9 and also it has not printed the final new line character (\n)
after this a shell script will append a trailer record (TRLR|727)with
the total number of records in the file.
Because the last record was half printed we are getting the trailer
record on the same line (appended to the last record) as follows
USP|200605|2212404|5314|15|880863|661897|CABL PLNT|1||TRLR|727|