SORT or ICETOOL to merger 2 80 byte records.



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

SORT or ICETOOL to merger 2 80 byte records.

Postby rahulkrddd » Sat Jul 28, 2018 3:39 pm

Hello Everyone,

I have a requirement where there are multiple records in the group of 2. Each record is of 80 byte length of a flat file. I have to merge the records so that -

The first 2 records of the input file should appear in the first row of output file.
Record 3 and 4 of the input file should appear in the 2nd row of output file.
Record 5 and 6 of the input file should appear in the 3rd row of output file. and so on...

File Type:
Input File : Type = Flat file (Physical Sequential file), LRECL = 80, RECFM = FB
Input File : Type = Flat file (Physical Sequential file), LRECL =160, RECFM = FB

Could you please help me with the JCL.
Also if possible, please let me know what changes needs to be done if input file is changed to VBA. Thank you.
rahulkrddd
 
Posts: 9
Joined: Sat Jul 28, 2018 3:31 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby rahulkrddd » Sat Jul 28, 2018 3:53 pm

I am not able to edit my post. Please do not get confused between input and output file. There is only one input and one output file as stated below-

File Type:
Input File : Type = Flat file (Physical Sequential file), LRECL = 80, RECFM = FB
Output File : Type = Flat file (Physical Sequential file), LRECL =160, RECFM = FB

Sorry for any inconvenience caused.
rahulkrddd
 
Posts: 9
Joined: Sat Jul 28, 2018 3:31 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby steve-myers » Sat Jul 28, 2018 4:19 pm

rahulkrddd wrote:I am not able to edit my post. ...

  • What does this have to do with Announcements / Forum Rules? Post in the correct forum!
  • You only have a few minutes (10? minutes) to edit a post. I have always found this to be annoying, but that's life.
  • I think, if my elderly memory is correct, this very topic was discussed in DFSort fairly recently.
  • "Merge" in the context of DFSort refers to the process of combining two (or more) already sorted data sets (not files) with common attributes to produce a third data set that is also sorted. You are concatenating two successive records to produce one longer record. Please be careful with your terminology. It makes searching for things much easier!
I will transfer this to DFSort for you.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby NicC » Sat Jul 28, 2018 5:13 pm

Look at RESIZE and examples in the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby rahulkrddd » Sun Jul 29, 2018 10:20 am

Thank you so much Steve/NicC, I got multiple examples but none of them matches with my requirements.

I will appreciate if I can get the answer in the Forum. Thanks.
rahulkrddd
 
Posts: 9
Joined: Sat Jul 28, 2018 3:31 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby NicC » Sun Jul 29, 2018 3:21 pm

Maybe none of them match your requirements exactly but did you read all topics containing resize? A search resulted in 45 hits - many were multiple hits on the same topic so not so much to look through. Did you also read the manual? Have you looked at the DFSort Tricks document which can be found by googling "Smart DFSort tricks"?

Did you try to code anything? If not, why not?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby rahulkrddd » Sun Jul 29, 2018 6:41 pm

I went through the manual and tried to understand before putting the question and I also went through the topics available but unable to code/understand because I'm not familiar with DFSort that's the reason I created ID and looked for help in the Forum for the first time.

But perhaps I'm at completely wrong place.
rahulkrddd
 
Posts: 9
Joined: Sat Jul 28, 2018 3:31 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby enrico-sorichetti » Sun Jul 29, 2018 7:29 pm

see here
ftp://ftp.software.ibm.com/storage/dfso ... rttrck.pdf
an search for the RESIZE command

in order to let Your neuron do less work here is a rework ( 80 to 160 ) of the sample in the linked doc


//RESIZE EXEC  PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN1      DD  ... input  file (FB/80)
//OUT1     DD  ... output file (FB/160)
//TOOLIN   DD  *
 RESIZE FROM(IN1) TO(OUT1) TOLEN(160)
 
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: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby NicC » Mon Jul 30, 2018 2:12 pm

Do NOT post the same question on multiple forums at the same time. It is rude - and generally will not help you get a faster answer and may slow down the response as people are put off by the rudeness.

Now that Enrico has given you the evr-so-simple answer are you now getting your desired result?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: SORT or ICETOOL to merger 2 80 byte records.

Postby steve-myers » Tue Jul 31, 2018 12:26 pm

If the BLKSIZE of the original data set is a multiple of 160, override the input data set LRECL --
//INPUT DD DCB=LRECL=160,...

Other than the JCL change, you don't have to do anything!

Enrico, I'm hardly a DFSort expert, but I think the output data set in your example is going to be --
input record 1 ... [nulls or blanks]
input record 2 ... [nulls or blanks]
...

I think the topic starter wants
input record 1 ...input record 2 ...
input record 3 ...input record 4 ...
...
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post