Search found 33 matches

by Magesh_j
Tue Sep 06, 2016 9:40 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Merge records from two file, one by one.
Replies: 14
Views: 1211

Re: Merge records from two file, one by one.

No problem Nic.

Thanks
Magesh
by Magesh_j
Tue Sep 06, 2016 9:39 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Joining two files with SORT.
Replies: 13
Views: 4835

Re: Joining two files with SORT.

Nic,

Mistake, agreed Datasets.

Thanks
Magesh
by Magesh_j
Tue Sep 06, 2016 9:36 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Merge records from two file, one by one.
Replies: 14
Views: 1211

Re: Merge records from two file, one by one.

Sorry Nic, I couldn't understand, As there is only one record in each dataset (not file) why are you sorting at all? As per the requirement, the input and output dataset has multiple records. File 1: AAA BBB CCC File 2: 9999 8888 7777 Output File: AAA 9999 BBB 8888 CCC 7777 Thanks Magesh
by Magesh_j
Tue Sep 06, 2016 9:29 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Merge records from two file, one by one.
Replies: 14
Views: 1211

Re: Merge records from two file, one by one.

Also you may use JOINKEYS, but consumes three pass without SORTing, where my previous solution consumes sorting with two pass. //S1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //INA DD DSN=FILE1,DISP=SHR //INB DD DSN=FILE2,DISP=SHR //SORTOUT DD SYSOUT=* //SYSIN DD * OPTION COPY JOINKEYS F1=INA,FIELDS=(81,08,...
by Magesh_j
Tue Sep 06, 2016 9:17 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Merge records from two file, one by one.
Replies: 14
Views: 1211

Re: Merge records from two file, one by one.

Imran Lamba, Assuming LRECL=80. //SORT010 EXEC PGM=SORT //SORTIN DD * BEGIN // DD DSN=FIRST.FIL,DISP=SHR // DD * BEGIN // DD DSN=SECOND.FIL,DISP=SHR //SORTOUT DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSIN DD * INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'BEGIN'), PUSH=(81:SEQ=8)) SORT FIELDS=(81,8,CH,A) ...
by Magesh_j
Tue Sep 06, 2016 8:33 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Joining two files with SORT.
Replies: 13
Views: 4835

Re: Joining two files with SORT.

Roohi, what is the output LRECL ? Whether fields you have are in fixed length or length varies ? Assuming output LRECL=80 and All the fields have fixed length then use the below code and you have only one record in each file. File 1(1,5) and File2 (1,14) //SORT010 EXEC PGM=SORT //SORTIN DD DSN=YOUR...
by Magesh_j
Mon Sep 05, 2016 9:59 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Compare two files and get RC=4.
Replies: 11
Views: 905

Re: Compare two files and get RC=4.

Yes, return code would be zero when file1< file2
And file1=file2.

It will set return code 4 when file1>file2.

Thanks
Magesh
by Magesh_j
Mon Sep 05, 2016 9:26 am
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Compare two files and get RC=4.
Replies: 11
Views: 905

Re: Compare two files and get RC=4.

mahigill,

I think still my solution works when file01<file02.

What made you think in other way.

Regards,
Magesh
by Magesh_j
Mon Sep 05, 2016 6:51 am
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Compare two files and get RC=4.
Replies: 11
Views: 905

Re: Compare two files and get RC=4.

Robert 10669 Magesh_J, mahigill: have either of you confirmed that your "solution" generates a return code of 4 if AND ONLY IF the record in the first file is greater than the record in the second file? If not, then at best you have generated a partial solution and at worst you have create...
by Magesh_j
Mon Sep 05, 2016 3:21 am
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Get record count while using SUM FIELDS in SORT.
Replies: 1
Views: 3587

Re: Get record count while using SUM FIELDS in SORT.

Assuming input is in sorted order 1,2 and the value field is right aligned (4,3), in your example you are showing it as left aligned. Here is the solution : OPTION COPY OUTFIL REMOVECC,NODETAIL, SECTIONS=(1,2, TRAILER3=(1,2,X,TOT=(4,3,ZD,TO=ZD,LENGTH=3),X,COUNT=(EDIT=(IT)))) If left aligned then //S...
by Magesh_j
Mon Sep 05, 2016 2:46 am
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Compare two files and get RC=4.
Replies: 11
Views: 905

Re: Compare two files and get RC=4.

Mahigill,

using sort fields unnecessarily is waste of cpu resource.
Even u can use joinkeys to achive this, sill requires three pass.

In other words there are many ways to achieve.

Your goal should be providing optimal solution if possible, rather than a solution
by Magesh_j
Sun Sep 04, 2016 9:25 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Add count based on the date.
Replies: 8
Views: 708

Re: Add count based on the date.

Nitin Gadge, why do you need a SORT FIELDS when the file is already in sorted order 1,10. SUM FIELDS=NONE will remove all your duplicates record,you will not get the desired output. use the below code to get the desired results. //SYSIN DD * OPTION COPY OUTFIL REMOVECC,NODETAIL, SECTIONS=(1,10, TRA...
by Magesh_j
Sun Sep 04, 2016 9:09 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: Compare two files and get RC=4.
Replies: 11
Views: 905

Re: Compare two files and get RC=4.

SarkarMain Here is code for you. //S1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=UR FILE1 // DD DSN=UR FILE2 //SORTOUT DD SYSOUT=* //SYSIN DD * INREC IFTHEN=(WHEN=GROUP, RECORDS=2, PUSH=(81:1,08,SEQ=1)) OPTION COPY,STOPAFT=2 OUTFIL INCLUDE(89,1,CH,EQ,C'2',AND, 1,8,CH,GE,81,8,CH), NULLOFL=RC...

Go to advanced search