Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: enrico-sorichetti
Subject: Reply to: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 1:37 am (GMT 5.5)

do not post images, a plain TEXT cut and paste from Your emulator window is more than enough.

the images will be deleted shortly
_________________
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 icon_cool.gif


DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: magesh23586
Subject: Reply to: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 3:35 am (GMT 5.5)

Quote:

I am using DFSORT and for this i have searched in the forum that SORTED,NOSEQCK should be used to accomplish my requirement


SORTED,NOSEQCK indicates records are already in order by the specified binary key, Sequence check will not be performed by dfsort.
_________________
Regards,
Magesh

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: magesh23586
Subject: Reply to: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 3:54 am (GMT 5.5)

Assuming both the files are in sorted order.

change the joinkeys as follows

UNTESTED
Code:

JOINKEYS FILES=F1,FIELDS=(01,15,A,174,4,A),SORTED,NOSEQCK   
JOINKEYS FILES=F2,FIELDS=(01,15,A,068,4,A),SORTED,NOSEQCK


Try Adding following statements.
Code:

//JNF1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(174:SEQ=4))         
//JNF2CNTL DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(068:SEQ=4))         


Let us know the results.
_________________
Regards,
Magesh

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: magesh23586
Posted: Mon Aug 28, 2017 4:10 am (GMT 5.5)

NOTE

In case you have more than one record for a key in file1 and only one matching key/record in file2, then only one record would be extracted from the input, the other records would be skipped.
_________________
Regards,
Magesh

DFSORT/ICETOOL :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: magesh23586
Subject: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 4:37 am (GMT 5.5)

Moderator,

Please move this page to syncsort.
_________________
Regards,
Magesh

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: frozenblood87
Subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 5:52 am (GMT 5.5)

magesh23586 wrote:
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X

Code:

OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),


Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL
_________________
Thanks

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: magesh23586
Subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 7:09 am (GMT 5.5)

frozenblood87 wrote:
magesh23586 wrote:
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X

Code:

OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),


Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL


I missed to notice the output LRECL
Code:

OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,125:X)

_________________
Regards,
Magesh

PL/I & Assembler :: RE: Help with EXCP

$
0
0
Author: steve-myers
Posted: Mon Aug 28, 2017 10:33 am (GMT 5.5)

I've spent more time and I'm just as confused.

This is the IOB.
Code:
 IOB                                                                 00000000
        +0  46000000 4102DF5C 0002DE28 0C400008
            0102DE10 0002DF68 00000000 00000000
       +20  00000001 45000000

The 0C400008 the device status and the residual byte count. The 0C is channel end / device end. The 40 is wrong length! I'm thinking it's saying that R0 - the record in the search ID equal - does not have a key and that's why it's unhappy.

I'm going to start with R1.


PL/I & Assembler :: RE: Help with EXCP

$
0
0
Author: steve-myers
Posted: Mon Aug 28, 2017 10:42 am (GMT 5.5)

That did it!

I switched to a data set with a multiple track search area and it seemed to work for the highest possible key.

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Poha Eater
Subject: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 3:04 pm (GMT 5.5)

Hi Enrico,

I will keep this in mind going forward. Thanks !

Hi Magesh,

The sort card you provided has worked and i am getting the exact results what i was expecting. I will post the results shortly. Thank you very much for this icon_biggrin.gif

I want to understand the meaning of what you coded :
JOINKEYS FILES=F1,FIELDS=(01,15,A,174,4,A),SORTED,NOSEQCK
JOINKEYS FILES=F2,FIELDS=(01,15,A,068,4,A),SORTED,NOSEQCK

Que - In above card for File F1 and File F2, is it sorting on 4 bytes from 174 and 068 ? I am confused about this part. Please guide here.

//JNF1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(174:SEQ=4))
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(068:SEQ=4))

Que : what does it means WHEN=GROUP in above card and does the PUSH keyword inserting a sequence no. of 4 bytes here ? If yes, then i will be having more than 6 lakhs records in my files so is it correct if i need to increase the length of SEQ from 4 to 6 ?
_________________
Thanks !

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Nic Clouston
Posted: Mon Aug 28, 2017 3:23 pm (GMT 5.5)

"lakhs" is not understood - please use English terminology.
_________________
Regards
Nic

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Poha Eater
Subject: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 4:59 pm (GMT 5.5)

Hi Nic,

I will be having 600,000 records in my file.


Thanks !
_________________
Thanks !

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: sergeyken
Subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 7:24 pm (GMT 5.5)

frozenblood87 wrote:
magesh23586 wrote:
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X

Code:

OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),


Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Whenever OUTFIL statement includes any of HEADERx= or TRAILERx= parameters, SYNCSORT by default increases record size by 1, and changes RECFM from FB to FBA, (or from VB to VBA). It assumes that using any HEADER/TRAILER involves mandatory printing of the produced report.
Nowadays it is usually not the case; in order to prevent this, your OUTFIL statement requires extra parameter REMOVECC:
Code:
 . . . . .
 OUTFIL REMOVECC, . . .
 . . . . . . .
 END 

_________________
Tyrannosaurus-REXX

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: sergeyken
Subject: Re: Reply to: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 7:45 pm (GMT 5.5)

magesh23586 wrote:
Assuming both the files are in sorted order.

change the joinkeys as follows

UNTESTED
Code:

JOINKEYS FILES=F1,FIELDS=(01,15,A,174,4,A),SORTED,NOSEQCK   
JOINKEYS FILES=F2,FIELDS=(01,15,A,068,4,A),SORTED,NOSEQCK


Try Adding following statements.
Code:

//JNF1CNTL DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(174:SEQ=4))         
//JNF2CNTL DD *                                                     
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,15),PUSH=(068:SEQ=4))         

Let us know the results.

It is not obvious that this approach will work, because the topic starter did not provide enough information on his requirements.
What is the role of each of joined files in his example?
For instance, both datasets have two records each with the same key field
Code:
2307914558..023
(assuming non-printed bytes '..' are the same? Or not?)
In terms of defined JOIN operation that means that the output file should include (2 * 2) = 4 output records with the same key; every record of F1 is matching with every record of F2. The given example demonstrates exactly the result which is expected by JOIN definition.

In the suggested solution with sequentially numbered records, for the given example the first matching F1 record will match with the first of F2 record, etc., but not clear if this is what the TS wanted from the beginning?
Let's say there are 100 same key records in F1, and 2 same key records in F2; in that case the SEQ= solution will produce 2 of the first matching records, and the rest 98 records of F1 should be silently ignored.
When using the original TS solution, this case should produce (100 * 2) = 200 output records.

Again: from the TS description it is not clear what is the actual task, and/or what is the role of each F1/F2 in his job?
_________________
Tyrannosaurus-REXX

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: sergeyken
Subject: Re: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 8:39 pm (GMT 5.5)

Poha Eater wrote:
I am using DFSORT and for this i have searched in the forum that SORTED,NOSEQCK should be used to accomplish my requirement.

I would recommend, before you get some basic knowledge about SORT/JOIN/MERGE processing, and used methods, - not to use the NOSEQCK option. Please, postpone even use of the SORTED option - at least until you're able to create yourself (not via copy-paste!) at least primitive, but really working, jobs for DFSORT/SYNCSORT.
_________________
Tyrannosaurus-REXX


DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: magesh23586
Subject: Reply to: Join records from 2 files with No Duplicates using DFSORT
Posted: Mon Aug 28, 2017 8:45 pm (GMT 5.5)

Poha Eater wrote:

Que - In above card for File F1 and File F2, is it sorting on 4 bytes from 174 and 068 ? I am confused about this part. Please guide here.


Poha Eater wrote:

what does it means WHEN=GROUP in above card


Refer DFSORT Application programming guide.

Quote:

does the PUSH keyword inserting a sequence no. of 4 bytes here ? If yes, then i will be having more than 6 lakhs records in my files so is it correct if i need to increase the length of SEQ from 4 to 6 ?


No, Not required, unless if you have more than 10K records having same key value.

I belive even 2 bytes is sufficient, i dont think you will have more than 99 records having same key.
_________________
Regards,
Magesh

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: Rohit Umarjikar
Posted: Mon Aug 28, 2017 9:04 pm (GMT 5.5)

Welcome!!
Quote:
I am using DFSORT and for this i have searched in the forum that SORTED,NOSEQCK should be used to accomplish my requirement.

You havn't done a proper research.

Why don't you eliminate duplicate before JOINKEYS by adding this piece to what you have posted?
Code:
//JNF1CNTL DD *     
  SUM FIELDS=NONE   
//*

Code:
//JNF2CNTL DD *     
  SUM FIELDS=NONE   
//*

or also try solution provide here or given above by magesh23586,
http://www.ibmmainframeforum.com/dfsort-icetool-icegener/topic5914.html
_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: frozenblood87
Subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 9:08 pm (GMT 5.5)

Thank you, I included the parameter to remove carriage control however I now get an error for overlapping fields, I have counted the positions and don't see an overlap, any idea what might be causing this error now? My output file is FB with LRECL of 125

Code:
SORT FIELDS=COPY                                           
OUTFIL REMOVECC,                                           
BUILD=(1:C'SYSTEM',21:131,6,41:81,19,61:51,20,             
       82:C'SKEL-ALL-SYS-ISSUE',102:131,6,                 
       108:C'                   ',125:X),                 
HEADER1=(1:C'UPDATER',21:C'PLUSS ID',41:C'LAST NAME',     
         61:C'FIRST NAME',82:C'TEMPLATE',102:C'PLUSS ID'),
HEADER2=('')   


Error-
Code:
WER136A  SORTOUT   OUTREC HAS OVERLAPPING FIELDS SPECIFIED


sergeyken wrote:
frozenblood87 wrote:
magesh23586 wrote:
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X

Code:

OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),


Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL

Whenever OUTFIL statement includes any of HEADERx= or TRAILERx= parameters, SYNCSORT by default increases record size by 1, and changes RECFM from FB to FBA, (or from VB to VBA). It assumes that using any HEADER/TRAILER involves mandatory printing of the produced report.
Nowadays it is usually not the case; in order to prevent this, your OUTFIL statement requires extra parameter REMOVECC:
Code:
 . . . . .
 OUTFIL REMOVECC, . . .
 . . . . . . .
 END 
Code:

_________________
Thanks

DFSORT/ICETOOL :: RE: Join records from 2 files with No Duplicates using DFSORT

$
0
0
Author: sergeyken
Posted: Mon Aug 28, 2017 9:26 pm (GMT 5.5)

Rohit Umarjikar wrote:
Welcome!!
Quote:
I am using DFSORT and for this i have searched in the forum that SORTED,NOSEQCK should be used to accomplish my requirement.

You havn't done a proper research.

Why don't you eliminate duplicate before JOINKEYS by adding this piece to what you have posted?
Code:
//JNF1CNTL DD *     
  SUM FIELDS=NONE   
//*

Code:
//JNF2CNTL DD *     
  SUM FIELDS=NONE   
//*

or also try solution provide here or given above by magesh23586,
http://www.ibmmainframeforum.com/dfsort-icetool-icegener/topic5914.html

A have to repeat again: it is not clear what is the role of each F1/F2 in the original task? Why multiple duplicate keys can appear in both F1+F2? What to do with duplicated key in each of them?

Eliminating duplicate keys via SUM FIELDS=NONE will create a single matching record produced, but (in general case) created from an unpredicted pair of matching keys.

Matching the pairs of records via use of re-numbered (via SEQ=) groups of records will create matching pairs from sequential duplicate key records, up to the minimum in each of F1, or F2; while the rest of same key records will be ignored.

The TS must clearly explain what his real requirements are, before trying to use (unknown to him) options of SORT control statements. Before clear understanding of the task, no advice from the Forum, and no control statement option would help. Period.
_________________
Tyrannosaurus-REXX

SYNCSORT :: RE: WER268A OUTREC STATEMENT : SYNTAX ERROR

$
0
0
Author: sergeyken
Subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
Posted: Mon Aug 28, 2017 9:34 pm (GMT 5.5)

frozenblood87 wrote:
Thank you, I included the parameter to remove carriage control however I now get an error for overlapping fields, I have counted the positions and don't see an overlap, any idea what might be causing this error now? My output file is FB with LRECL of 125

Temporary remove your HEADER parameter, and then carefully analyze the produced output record - the field sizes, and positions, and the whole LRECL produced.

Next, accurately re-calculate all the required size, and position of your HEADER fields, and include the updated HEADER parameter back to OUTFIL statement.

You can also add the HEADER sub-parameters one by one to your OUTFIL statement, until you get the first error message. This will point you to your particular erroneous HEADER element.

There are no such things as miracles.
This job is not rocket science - this is primitive arithmetic in calculation of field positions.
_________________
Tyrannosaurus-REXX

Viewing all 8500 articles
Browse latest View live