Hello everybody
Needing some help with a problem. I have a file with a header and details records but file can have multiple header. Here is a sample
0720040050720H32B75W
10161007178541051100010
10161007178541055900010
10161007178541510900010
10161007178541057000010
10161007178541051300010
10161000733690601100010
10161007178541062300010
10161007178541063000010
10171000180006562000010
10171000180006554000010
0720040050720N126708
10440000000046401600200
0720040050720N126708
10011000710070900900040
10011000710070100100020
10011000710070200200010
10011000447000036800010
10011000710074053300010
10011000710074053100010
this is wht i wanna do read the file if header record read the detail till next header. add header record with details something like
100110007100709009000400720040050720N126708
... and so on. Problem gets even better i have 30 file like this that need to be appended in the newly created outfile.
Greatful for any help provided.
if anybody interested here is FD for the file
*FD ORDER-INPUT-FILE
DATA RECORD IS ORDER-INPUT-REC.
01 ORDER-INPUT-REC.
03 ORDER-INPUT-RECORD-TYPE PIC X.
*************RECORD-TYPE 0 = Header 1 = Detail
03 ORDER-INPUT-HEADER.
05 ORDER-INPUT-SOURCE PIC X.
05 ORDER-INPUT-FORMAT PIC X.
05 ORDER-INPUT-APPLIC PIC XX.
****************Store 1=4001, 2=4002, 3=4004, 4=4005
05 ORDER-INPUT-STORE-NUMBER PIC 9(4).
05 ORDER-INPUT-SHIPPING-MMDD PIC 9(4).
05 ORDER-INPUT-SERIAL-NO PIC X(.
05 FILLER PIC XX.
03 ORDER-INPUT-DETAIL REDEFINES
ORDER-INPUT-HEADER.
05 ORDER-INPUT-BREAKER-CODE PIC 999.
05 ORDER-INPUT-TYPE-INDICATOR PIC X.
****************AWG No/UPC Code will be numeric, right justfied
****************The field below can be either AWG no or UPC Code,
****************depending on the Type Indicator
05 ORDER-INPUT-AWG-UPC-NO PIC X(13).
05 ORDER-INPUT-QTY PIC 9(4).
05 ORDER-INPUT-LABEL-INDICATOR PIC X.
Needing some help with a problem. I have a file with a header and details records but file can have multiple header. Here is a sample
0720040050720H32B75W
10161007178541051100010
10161007178541055900010
10161007178541510900010
10161007178541057000010
10161007178541051300010
10161000733690601100010
10161007178541062300010
10161007178541063000010
10171000180006562000010
10171000180006554000010
0720040050720N126708
10440000000046401600200
0720040050720N126708
10011000710070900900040
10011000710070100100020
10011000710070200200010
10011000447000036800010
10011000710074053300010
10011000710074053100010
this is wht i wanna do read the file if header record read the detail till next header. add header record with details something like
100110007100709009000400720040050720N126708
... and so on. Problem gets even better i have 30 file like this that need to be appended in the newly created outfile.
Greatful for any help provided.
if anybody interested here is FD for the file
*FD ORDER-INPUT-FILE
DATA RECORD IS ORDER-INPUT-REC.
01 ORDER-INPUT-REC.
03 ORDER-INPUT-RECORD-TYPE PIC X.
*************RECORD-TYPE 0 = Header 1 = Detail
03 ORDER-INPUT-HEADER.
05 ORDER-INPUT-SOURCE PIC X.
05 ORDER-INPUT-FORMAT PIC X.
05 ORDER-INPUT-APPLIC PIC XX.
****************Store 1=4001, 2=4002, 3=4004, 4=4005
05 ORDER-INPUT-STORE-NUMBER PIC 9(4).
05 ORDER-INPUT-SHIPPING-MMDD PIC 9(4).
05 ORDER-INPUT-SERIAL-NO PIC X(.
05 FILLER PIC XX.
03 ORDER-INPUT-DETAIL REDEFINES
ORDER-INPUT-HEADER.
05 ORDER-INPUT-BREAKER-CODE PIC 999.
05 ORDER-INPUT-TYPE-INDICATOR PIC X.
****************AWG No/UPC Code will be numeric, right justfied
****************The field below can be either AWG no or UPC Code,
****************depending on the Type Indicator
05 ORDER-INPUT-AWG-UPC-NO PIC X(13).
05 ORDER-INPUT-QTY PIC 9(4).
05 ORDER-INPUT-LABEL-INDICATOR PIC X.