Hi,
I want to reformat a file with LRECL=126 into the below format.changes need to do are in bold.As i haven't use ICETOOL finding bit difficult.please help me
Detail:
col character_length notes
1 3 constant
27 17 constant-left justify
44 20 constant-left justify
64 28 right justified with spaces
92 10 date in YYYYMMDD format
112 15 left justified with spaces except add a zero before
the value
LRECL =126,RECFM =F for both input and output files.
Input file description:
header:
pos value in field
1-3 000
4-3 1 (first 2 are spaces)
7-20 72341765 (first and last 6 are spaces ,data is in the middle)
Detail:
pos value in field
1-3 110
4-26 spaces-no data
27-43 8901034567 (first 8 are spaces then data )
44-63 tmt (first 17 are spaces then value 'tmt')
64-91 0000043634(first 19 are spaces then value)
92-101 20081118(date in YYYYMMDD format with leading 2 spaces)
102-111 spaces-no data
112-126 0000038164(first 5 are spaces then data starts with zeros)
Output needs to be:
Header:
pos value in field
1-3 000(no change)
4-3 1 (left justify with spaces)
7-20 72341765 (left justify with spaces)
detail:
pos value in field
1-3 110(no change)
4-26 spaces-no data(no change)
27-43 8901034567 (left justify-i.e first data starts then with 8 trailing spaces)
44-63 tmt (left justify-i.e. first 'tmt' then 17 trailing spaces)
64-91 000000000000000043634(instead of leading spaces and >0 we need to move zeros then data)
92-101 20081118(no change)
102-111 spaces-no data(no change)
112-126 038164(left justify with spaces and add zero before the value
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Your descriptions are a bit difficult to follow, but here's a DFSORT job that will do what you asked for based on my best guess of what your data looks like from the descriptions you gave. Change as needed.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Actually, it won't work correctly if the numeric value in 112-126 has trailing zeros (e.g. 12300). So I've changed my post above to use the correct control statements for handling that situation.