rajinfy123 Beginner
Joined: 10 Jan 2007 Posts: 1 Topics: 1
|
Posted: Mon Apr 27, 2009 4:41 pm Post subject: Syncsort - Report from reading rows b/n multiple HDR & T |
|
|
In the below first 3 byte determine the record-type and remaining all are different field values.A report is to be generated reading HDR record until next HDR record encountered. Read each of GRP record for first 3 field values followed by next associated SUB records until next GRP record encountered. In the SUB record consider last 2 field value for the report.In the report, Page number to be incremented only within HDR to TRL, as soon as another HDR encountered,Page number to be restarted from 1 again.
Pls let me know if anything unclear.
Thanks in advance for your help,
Raj.
[code]
INPUT:
~~~~~~
HDR TZ100PQRTK200
GRP YAHOO 1000 CAR XXXXX
SUB MARY SMITH HONDA ACCORD
SUB JOHN SMITH TOYOTA CAMRY
SUB ALEX SMITH NISSAN MAXIMA
GRP INFY 3114 MINIVAN YYYYY
SUB ANNY LEADS TOYOTA INNOVA
TRL00006
HDR TZ400PQRTQ300
GRP MICTEK 3111 CAR ZZZZZ
SUB RAJ PATEL HONDA CIVIC
SUB MOHAN JOHN FORD MUSTANG
TRL 00003
Output expected:
~~~~~~~~~~~~~~~~
TZ100PQRTK200 PAGE : 1
ROWHDR1 ROWHDR2 ROWHDR3 ROWHDR4 ROWHDR5
~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
YAHOO 1000 CAR HONDA ACCORD
YAHOO 1000 CAR TOYOTA CAMRY
YAHOO 1000 CAR NISSAN MAXIMA
INFY 3114 MINIVAN TOYOTA INNOVA
TZ400PQRTQ300 PAGE : 1
ROWHDR1 ROWHDR2 ROWHDR3 ROWHDR4 ROWHDR5
~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~ ~~~~~~~
MICTEK 3111 CAR HONDA CIVIC
MICTEK 3111 CAR FORD MUSTANG
[/code] |
|