Page 1 of 1

Count & Reformat the record

PostPosted: Sat Dec 21, 2019 3:52 am
by gurvinder23
I have a below requirement

A file may have only trailer record or records with header, detail & trailer record on some day

Input file data:
00ABCDEFG0999XYZ
when it is only trailer

When its with header and other data
00ABCDEFG0000XYZ XHIOXOIXHOXHOXHXOHOXH
 00ABCDEFG0999XYZ


Input file length: 80

I need to check if data at a position 3,11,CH,EQ,C'ABCDEFG0999' and when count is only 1, then reformat the input record and add a header to it otherwise no action required

How can I achieve this by ICETOOL.

Re: Count & Reformat the record

PostPosted: Sat Dec 21, 2019 5:44 pm
by NicC
file - Do you mean dataset
Input file length: 80 - Do you mean record length?
How can I achieve this by ICETOOL. What if it can be done with DFSort without resorting to ICETOOL?

What do you mean by 'reformat input'? Reformt how?
Please show example input and matching output (and use the code tags to present your data).

(And how about completing your previous topic?)

Re: Count & Reformat the record

PostPosted: Sat Dec 21, 2019 7:20 pm
by enrico-sorichetti
(And how about completing your previous topic?)


the TS other topic is more than 10 years old ;)

Re: Count & Reformat the record

PostPosted: Sun Dec 22, 2019 2:08 am
by NicC
I know, but it is never too late to be polite.

Re: Count & Reformat the record

PostPosted: Mon Dec 23, 2019 11:54 pm
by gurvinder23
Sorry for not mentioning the requirement clearly.

Yes file means a dataset
The record length is 80

Input data will look like as follows:

1. When its only trailer record
00ABCDEFG0999XYZ

2. When it has header, data and tralier
00ABCDEFG0000XYZ XHIOXOIXHOXHOXHXOHOXH
00ABCDEFG0999XYZ

I need to check if data at a position 3,11,CH,EQ,C'ABCDEFG0999' and when record count in the input dataset is only 1 (mentioned above in point 1), then I need to build the output data as mentioned in point 2 ELSE no action required.


00ABCDEFG0000XYZ - Header
XHIOXOIXHOXHOXHXOHOXH - Data
00ABCDEFG0999XYZ - Trailer

How can I achieve this using DFSORT/ICETOOL.

Re: Count & Reformat the record

PostPosted: Thu Dec 26, 2019 7:56 pm
by sergeyken
You can achieve this doing exactly what DFSORT/ICETOOL manual says.

Did you read the manual?

If no, - then do it first.
If yes, - what did you try so far? What is your code? What are the test results?

Re: Count & Reformat the record

PostPosted: Thu Dec 26, 2019 8:16 pm
by sergeyken
gurvinder23 wrote:2. When it has header, data and tralier
00ABCDEFG0000XYZ XHIOXOIXHOXHOXHXOHOXH
00ABCDEFG0999XYZ

I need to check if data at a position 3,11,CH,EQ,C'ABCDEFG0999' and when record count in the input dataset is only 1 (mentioned above in point 1), then I need to build the output data as mentioned in point 2 ELSE no action required.


00ABCDEFG0000XYZ - Header
XHIOXOIXHOXHOXHXOHOXH - Data
00ABCDEFG0999XYZ - Trailer


Is your "data" combined into the same record as your "header"?
Do you really want to split it into separate records on output? Or not?

Please, try to explain your brain in the manner that others would be able to understand, too.
Otherwise it's all wasting of time.

Re: Count & Reformat the record

PostPosted: Fri Dec 27, 2019 1:17 am
by NicC
The real solution is to get the data created correctly in the first place. Raise a change request against the responsible group.

Re: Count & Reformat the record

PostPosted: Fri Dec 27, 2019 9:14 am
by gurvinder23
I will raise the change request to get the data corrected from other group. Thanks a lot for your response.