Page 1 of 2

SORT or ICETOOL to merger 2 80 byte records.

PostPosted: Sat Jul 28, 2018 3:39 pm
by rahulkrddd
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.

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

PostPosted: Sat Jul 28, 2018 3:53 pm
by rahulkrddd
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.

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

PostPosted: Sat Jul 28, 2018 4:19 pm
by steve-myers
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.

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

PostPosted: Sat Jul 28, 2018 5:13 pm
by NicC
Look at RESIZE and examples in the forum.

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

PostPosted: Sun Jul 29, 2018 10:20 am
by rahulkrddd
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.

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

PostPosted: Sun Jul 29, 2018 3:21 pm
by NicC
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?

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

PostPosted: Sun Jul 29, 2018 6:41 pm
by rahulkrddd
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.

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

PostPosted: Sun Jul 29, 2018 7:29 pm
by enrico-sorichetti
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)
 

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

PostPosted: Mon Jul 30, 2018 2:12 pm
by NicC
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?

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

PostPosted: Tue Jul 31, 2018 12:26 pm
by steve-myers
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 ...
...