Count & Reformat the record



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Count & Reformat the record

Postby gurvinder23 » Sat Dec 21, 2019 3:52 am

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.
gurvinder23
 
Posts: 4
Joined: Thu Aug 13, 2009 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Count & Reformat the record

 

Re: Count & Reformat the record

Postby NicC » Sat Dec 21, 2019 5:44 pm

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?)
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2953
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 134 times

Re: Count & Reformat the record

Postby enrico-sorichetti » Sat Dec 21, 2019 7:20 pm

(And how about completing your previous topic?)


the TS other topic is more than 10 years old ;)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2890
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 153 times

Re: Count & Reformat the record

Postby NicC » Sun Dec 22, 2019 2:08 am

I know, but it is never too late to be polite.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2953
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 134 times

Re: Count & Reformat the record

Postby gurvinder23 » Mon Dec 23, 2019 11:54 pm

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.
gurvinder23
 
Posts: 4
Joined: Thu Aug 13, 2009 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Count & Reformat the record

Postby sergeyken » Thu Dec 26, 2019 7:56 pm

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?
sergeyken
 
Posts: 37
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Count & Reformat the record

Postby sergeyken » Thu Dec 26, 2019 8:16 pm

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.
sergeyken
 
Posts: 37
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Count & Reformat the record

Postby NicC » Fri Dec 27, 2019 1:17 am

The real solution is to get the data created correctly in the first place. Raise a change request against the responsible group.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2953
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 134 times

Re: Count & Reformat the record

Postby gurvinder23 » Fri Dec 27, 2019 9:14 am

I will raise the change request to get the data corrected from other group. Thanks a lot for your response.
gurvinder23
 
Posts: 4
Joined: Thu Aug 13, 2009 3:15 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post