Writing multiple files from single file using sort



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

Writing multiple files from single file using sort

Postby mojo732 » Sat Jul 13, 2019 3:38 pm

Hi there,

I want to create multiple output files from a single output file. My req. is as follow

input rec:
01JUMMY TUMMY
02AUMMY BUMMY
01DUMMY GUMMY
02FUMMY EUMMY

OUTPUTFILE1:
01JUMMY
01DUMMY

OUTPUTFILE2:
02AUMMY
02FUMMY

OUTPUTFILE3:
01TUMMY
01GUMMY

OUTPUTFILE4:
02BUMMY
02EUMMY

Please help.
mojo732
 
Posts: 5
Joined: Wed Jul 10, 2019 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Writing multiple files from single file using sort

 

Re: Writing multiple files from single file using sort

Postby NicC » Sun Jul 14, 2019 2:34 am

1) Explain how you get that output from that input.
2) Also state the LRECL and RECFM of your DATA SETs (they are not files).
3) Use the code tags to present your data
4) What have you tried?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2902
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 132 times

Re: Writing multiple files from single file using sort

Postby mojo732 » Sun Jul 14, 2019 9:02 am

Hi NicC,

1) The input is actually is in the format as

01 REC-1 REC-2
02 REC-1 REC-2
03 REC-1 REC-4
..
..
12 REC-1 REC-2

I want to write the input into 12 output files for REC-1 as below.
01 REC-1
02 REC-1
..
..
12 REC-1

Similarly for REC-2 with 12 files for 12 partitions.
01 REC-2
02 REC-2
..
..
12 REC-2


2. The datasets are FB, LRECL of 1625.

3. It is in below format.
<FILE NUMBER> <REC-1> <REC-2>
4. I am new to SORT. I found a sort card on forum where i can write these datasets using OUTFIL along with INCLUDE COND. I believe we got to have a BUILD along. Hence the post. :)

Thanks for taking time. Let me for know for any details.
mojo732
 
Posts: 5
Joined: Wed Jul 10, 2019 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Writing multiple files from single file using sort

Postby NicC » Sun Jul 14, 2019 1:22 pm

What are the field definitions - data type, start column, length?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2902
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 132 times

Re: Writing multiple files from single file using sort

Postby mojo732 » Mon Jul 15, 2019 8:09 am

Yes NicC.
The first field is 9(02)
REC-1 - 746 BYTES
REC-2 - 877 BYTES

REC-1 and REC-2 are db2 unloads. So, they have a mix of Data types as X, 9, Comp etc. I would want to move all record as said.

Thanks!
mojo732
 
Posts: 5
Joined: Wed Jul 10, 2019 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Writing multiple files from single file using sort

Postby NicC » Mon Jul 15, 2019 1:40 pm

Start column of rec-1? start column of rec-2? Data type of first field (zoned decimal, packed decimal, binary)?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2902
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 132 times

Re: Writing multiple files from single file using sort

Postby mojo732 » Mon Jul 15, 2019 3:03 pm

REC-1 starts from 3. REC-2 STARTS FROM 749. AS IT IS 02+746+877=1625

Data type of first field as I said is numeric 9(02).
mojo732
 
Posts: 5
Joined: Wed Jul 10, 2019 1:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Writing multiple files from single file using sort

Postby NicC » Mon Jul 15, 2019 3:28 pm

DFsort only understands bits. How those bits are to be interpreted has to be specified in the control statements and 'numeric' is not one of those specifications.
Numeric can be Zoned Decimal, Packed Decimal (comp-3 in cobol-ese) or binary (comp in cobol-ese).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2902
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 132 times

Re: Writing multiple files from single file using sort

Postby mojo732 » Mon Jul 15, 2019 6:11 pm

It is ZD.
mojo732
 
Posts: 5
Joined: Wed Jul 10, 2019 1:53 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post