IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort JCL Help Needed to compare and delete between two files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Sat Feb 18, 2012 4:07 pm
Reply with quote

Raj4neo,

MAXSORT is used, if the job abends with "Sort capacity exceeded" msg.
Not required in this contest. And also MAXSORT won't work for Joinkeys.

Provide WER* code in Sysout for your below job..

Quote:


I was trying to Sort two PS file with VB record having Lrecl 3313 , Using Joinkeys to identify Matched records and Unmatched record from file

If i try with 20 records its working fine , the same sortcard if i try for 70000 records its giving

SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004



Thanks
-3nadh
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 18, 2012 4:40 pm
Reply with quote

Do you have 70,000 records, or a huge amount?

I now see -3nadh has covered some of the points.

I can only look for so long before mentioning this, though it is unrelated to your abend.

Code:
INCLUDE=(3318,1,CH,NE,X'FF',AND,3318,1,CH,NE,X'FF'),


What is the converting to Variable about? The 3318 position also looks like you think something is variable.

You don't seem to use the F2 data apart from the test for x'ff', so why include the whole F2 record, why not just one byte?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Sat Feb 18, 2012 10:22 pm
Reply with quote

I tried with One byte in F2 record its not working same abend

Yes it will have up to 5000 records and Both file is VB of Lrecl 3313

UNSUCCESSFUL SORT 0C4 S

SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004
TIME=08.33.59 SEQ=33663 CPU=0000 ASID=01A8
PSW AT TIME OF ERROR 078D0000 00144DEE ILC 6 INTC 04
NO ACTIVE MODULE FOUND
NAME=UNKNOWN


But if i try with 10 records in each file , Its going through well
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 18, 2012 11:01 pm
Reply with quote

Can you show the output messages: from the small one which works, and from the large one of somehow indeterminate size?

Can you show your current sort cards, and describe as fully as possible what you are trying to achieve?

You say your input is VB? Do you have different-sized records? Assuming yes, can you confirm minimum length and whether all are to be processed the same?

Better show us the JCL as well.

Can you look back through any previous questions, and provide replies for those as well, please?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Sat Feb 18, 2012 11:14 pm
Reply with quote

Please find the JCl

Code:
//SYSOUT DD SYSOUT=*                                   
//SORTJNF1 DD DSN=BPV380.R.K.H2,DISP=SHR               
//SORTJNF2 DD DSN=BPV380.R.K.H1,DISP=SHR               
//MATCHES  DD DSN=BPV380.T11,DISP=(NEW,CATLG,DELETE),   
//           DATACLAS=MB001,                           
//           DCB=(RECFM=VB,LRECL=3313,BLKSIZE=0)       
//NOMATCH1 DD DSN=BPV380.T12,DISP=(NEW,CATLG,DELETE),   
//           DATACLAS=MB001,                           
//           DCB=(RECFM=VB,LRECL=3313,BLKSIZE=0)       
//SYSIN   DD *                                         
 JOINKEYS FILES=F1,FIELDS=(5,1000,A)                   
JOINKEYS FILES=F2,FIELDS=(5,1000,A)                     
JOIN UNPAIRED,F1                                         
REFORMAT FIELDS=(F1:1,3313,F2:1,3313),FILL=X'FF'         
OPTION COPY                                             
OUTFIL FNAMES=NOMATCH1,                                 
INCLUDE=(3318,1,CH,EQ,X'FF'),                           
OUTREC=(05,3309),FTOV,VLTRIM=X'FF'                       
 OUTFIL FNAMES=MATCHES,                                 
  INCLUDE=(3318,1,CH,NE,X'FF',AND,3318,1,CH,NE,X'FF'),   
  OUTREC=(05,3309),FTOV,VLTRIM=X'FF'                     
/*

If i am using for 10 records Output is :

Code:
 JOINKEYS REFORMAT RECORD LENGTH= 6626, TYPE = F                       
 NOMATCH1 : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 MATCHES  : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 5,148K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,       
    0 BYTES RESERVE REQUESTED, 100K BYTES USED                         
 NOMATCH1 :  DATA RECORDS OUT          9; TOTAL RECORDS OUT          9
 MATCHES  :  DATA RECORDS OUT          1; TOTAL RECORDS OUT          1
 SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
 OUTFIL WAS USED FOR SORTOUT                                           
 RCD IN         10, OUT         10                                     

And if i use my original file which is having 20k records

Code:
     0 BYTES RESERVE REQUESTED, 1,102,192 BYTES USED                 
  20K BYTES OF EMERGENCY SPACE ALLOCATED                             
  JOINKEYS REFORMAT RECORD LENGTH= 6626, TYPE = F                   
  NOMATCH1 : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998               
  MATCHES  : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998               
  13,000K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,   
     0 BYTES RESERVE REQUESTED, 100K BYTES USED                     
  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               
  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE 

Job fails with user abend U0016
Jesmsg shows
Code:
+WER999A BPV380SM,SRTMAT  ,        -  UNSUCCESSFUL SORT 0C4 S
IEA995I SYMPTOM DUMP OUTPUT  313                             
SYSTEM COMPLETION CODE=0C4  REASON CODE=00000004             
 TIME=08.33.59  SEQ=33663  CPU=0000  ASID=01A8               
 PSW AT TIME OF ERROR  078D0000   00144DEE  ILC 6  INTC 04   
   NO ACTIVE MODULE FOUND                                   
   NAME=UNKNOWN     


Infile Record details

All the records will have minimum of 1600 byte

Eg layout with Hex format

Code:
5     9           120411        r                                       
F00000F44444440000FFFFFF000000009000000000004444444444444444444444444444
50000C90000000000C12041100C00C049C000C000C0C0000000000000000000000000000
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 18, 2012 11:42 pm
Reply with quote

OK, let's pretend all your records are 1604 and you run through the JCL and sort cards you have. You'll get two-and-a-bit records are a time in each part of your REFORMAT statement. At some point, one of the 1604 records will be at the end of a block which is followed by storage you are not able to access, and S0C4.

Same thing if you have a mix of records. At some point a 1604 is going to be last or 2nd-to-last in the block.

Your REFORMAT and other cards need to deal with variable-length records. Consult your documentation/look for examples of join with variabl-length records and REFORMAT. I don't have Syncsort documentation, so can't assist directly,
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Sat Feb 18, 2012 11:58 pm
Reply with quote

I was trying with same sort card for having Variable Length file of lrcl 504 Its working fine , Really i am nt getting any clue why its not working for Lrecl 3313

Bill You are trying to say its becasue of Storage issue
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Feb 19, 2012 12:31 am
Reply with quote

No. I'm saying that when you have a record which is shorter than your maximum, with your existing sort cards you are attempting to get datat from beyond the end of the record. When that "falls off" the record buffer, you get the S0C4 if it is into storage you are not allowed to access.

If you have a 1604 record, you must only access 1604 bytes. Same for any other records you have that are not maximum length.

Your REFORMAT would be fine for fixed-length records. You need to write one for variable-length records.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Feb 19, 2012 5:31 am
Reply with quote

Code:

 JOINKEYS FILES=F1,FIELDS=(5,1000,A)                   
 JOINKEYS FILES=F2,FIELDS=(5,1000,A)                       
 JOIN UNPAIRED,F1                                           
 REFORMAT FIELDS=(F1:1,4,F2:1,4,F1:5)         
 OPTION COPY                                             
 OUTFIL FNAMES=NOMATCH1,                                 
               INCLUDE=(5,2,CH,EQ,X'0000'),                           
               OUTREC=(1,4,9)                       
 OUTFIL FNAMES=MATCHES,                                 
               SAVE,   
               OUTREC=(1,4,9)                   


On the REFORMAT, first take the RDW from F1. Then, so we know where to find it, take the RDW from F2. For an unmatched F1, there will be no F2 and the first two bytes of the F2 RDW will be X'0000'. This we use as your "not matched" indicator. Next, put the entire variable-length record from F1, by specifying 5 as a start position but not specifying a length. The length used will be the length of the current record, less the first four bytes of the RDW.

You now have a variable-length reformat record.

You have a new test for matched or not, on the record-length in the RDW from F2.

In the OUTRECs it copies the RDW from the reformat record (the 1,4) and then ignores the RDW from F2 and gets all the data from position 9 to end-of-record. The actual record-length of your output record will be adjusted to reflect the amount of data present in the OUTREC record, but it must start from the original RDW, in this case of the reformat record.

I don't have Syncsort, so can't test, but this might give you a push in the right type of direction. In DFSORT I'd do it differently, because there is an indicator available to show the state of the match which can be included on the reformat record.

It is a good example for the use of SYMNAMES.
Code:

//SYMNAMES DD *
* Data layout for F1 record
F1-RDW,1,4,CH
F1-REST-OF-RECORD,*
F1-KEY,5,1000,CH
* Data layout for F1 record
F2-RDW,1,4,CH
F2-KEY,5,1000,CH
* Data layout for reformat record
REFORMAT-RECORD-RDW,1,4,CH
* Fixed portion of reformat record
REFORMAT-F2-RDW,*,4,CH
REFORMAT-F2-RECORD-LENGTH,=,2,C
REFORMAT-F2-IOCS,*,2,CH
* Variable portion of reformat record
REFORMAT-F1-REST,*
* Constants
NO-F2-ZERO-LENGTH,X'0000'
//SORTIN DD *

 JOINKEYS FILES=F1,FIELDS=(F1-KEY,A)                   
 JOINKEYS FILES=F2,FIELDS=(F2-KEY,A)               
         
 JOIN UNPAIRED,F1                                           

 REFORMAT FIELDS=(F1:F1-RDW,
                  F2:F2-RDW,
                  F1:F1-REST-OF-RECORD)         

 OPTION COPY                                             

 OUTFIL FNAMES=NOMATCH1,                                 
          INCLUDE=(REFORMAT-F2-RECORD-LENGTH,
                  EQ,
                   NO-F2-ZERO-LENGTH),                           

   OUTREC=(REFORMAT-RDW,REFORMAT-F1-REST)                       

 OUTFIL FNAMES=MATCHES,       
          INCLUDE=(REFORMAT-F2-RECORD-LENGTH,
                  NE,
                   NO-F2-ZERO-LENGTH),                           

   OUTREC=(REFORMAT-RDW,REFORMAT-F1-REST)
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Sun Feb 19, 2012 10:31 pm
Reply with quote

Bill,

Thanks for your Support ,

I tried with this sort card , its giving U0016

SYSIN :
Code:
  JOINKEYS FILES=F1,FIELDS=(5,1000,A)               
  JOINKEYS FILES=F2,FIELDS=(5,1000,A)               
  JOIN UNPAIRED,F1                                 
  REFORMAT FIELDS=(F1:1,4,F2:1,4,F1:5)             
  OPTION COPY                                       
  OUTFIL FNAMES=NOMATCH1,                           
  INCLUDE=(5,2,BI,EQ,X'0000'),                     
  OUTREC=(1,4,9,3309)                               
   OUTFIL FNAMES=MATCHES,                           
    INCLUDE=(5,2,BI,NE,X'0000'),                   
    OUTREC=(1,4,9,3309)                             

Code:
 JOINKEYS REFORMAT RECORD LENGTH= 3317, TYPE = V                       
 NOMATCH1 : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 MATCHES  : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 5,148K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,       
    0 BYTES RESERVE REQUESTED, 100K BYTES USED                         
 NOMATCH1 OUTREC - SHORT RECORD                                       
 SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
 JNF1 STATISTICS                                                       
 1,544K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
    0 BYTES RESERVE REQUESTED, 1,512K BYTES USED                       
 SORTJNF1 : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 G=1003,SEGLEN=1104                                                   
 SORTJNF1 : EXCP'S=1,UNIT=3390,DEV=D0E6,CHP=(01050D12161F22,1),VOL=FPA2
 TOTAL OF 1 EXCP'S ISSUED FOR SORTING                                 
 FILESIZE 22,070 BYTES                                                 
 JNF2 STATISTICS                                                       
 1,544K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
    0 BYTES RESERVE REQUESTED, 1,512K BYTES USED                       
 SORTJNF2 : RECFM=VB   ; LRECL=  3313; BLKSIZE= 27998                 
 G=1003,SEGLEN=1104                                                   
 SORTJNF2 : EXCP'S=1,UNIT=3390,DEV=D0D4,CHP=(01050D12161F22,1),VOL=FPA2
 TOTAL OF 1 EXCP'S ISSUED FOR SORTING                                 
 FILESIZE 21,920 BYTES   


Please correct my mistakes
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Feb 19, 2012 11:39 pm
Reply with quote

when posting JCL snippets and screen text it would be nice to use the code tags
they keep things aligned and make understanding easier for the people trying to help
( Your previous post has been code tagged )
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Feb 19, 2012 11:58 pm
Reply with quote

It is not so helpful to cut off the messages. Although I can't necessarily look them up, I can't see the "A" suffix message.

Let's guess that it is "NOMATCH1 OUTREC - SHORT RECORD".

OK, hint that it is on OUTREC for NOMACTCH1

Code:
OUTREC=(1,4,9,3309)


Compare to mine:

Code:
OUTREC=(1,4,9)


Yours copies from 9 for a length of 3309.

Mine copies from 9 for a length of record-length of reformat record minus eight.

Guess which will give a "short record" message when a 1604-length record comes along?

I notice you also changed CH to BI on the INCLUDE. If you want to do that, you can test against 0, you'd not need to test for X'0000'. If you want to test for X'0000' no need for it to be BI. Causes confusion to the reader to mix, in my opinion.

If you tried mine and they didn't work, say so. It is certainly possible. Otherwise, why did you change them without trying them?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Mon Feb 20, 2012 12:39 am
Reply with quote

Sort card is working for 10 records , But if use my entire file its giving ABENDU0016

Code:
+WER999A BPV380SM,SRTMAT  ,        -  UNSUCCESSFUL SORT 0C4 S
IEA995I SYMPTOM DUMP OUTPUT  903                             
SYSTEM COMPLETION CODE=0C4  REASON CODE=00000004             
 TIME=10.48.48  SEQ=20731  CPU=0000  ASID=00E2               
 PSW AT TIME OF ERROR  078D0000   00116DEE  ILC 6  INTC 04   
   NO ACTIVE MODULE FOUND                                   
   NAME=UNKNOWN               


I tried with More Sort workspace it didnt works

My thinking is it may be due it cannot expand the Block size


Code:


 SYSIN :                                         
  JOINKEYS FILES=F1,FIELDS=(5,1000,A)           
  JOINKEYS FILES=F2,FIELDS=(5,1000,A)           
  JOIN UNPAIRED,F1                               
  REFORMAT FIELDS=(F1:1,4,F2:1,4,F1:5)           
  OPTION COPY                                   
  OUTFIL FNAMES=NOMATCH1,                       
  INCLUDE=(5,2,CH,EQ,X'0000'),                   
  OUTREC=(1,4,9)                                 
   OUTFIL FNAMES=MATCHES,                       
    INCLUDE=(5,2,CH,NE,X'0000'),                 
    OUTREC=(1,4,9)                               

JOINKEYS REFORMAT RECORD LENGTH= 3317, TYPE = V
NOMATCH1 : RECFM=VB ; LRECL= 3313; BLKSIZE= 27998
MATCHES : RECFM=VB ; LRECL= 3313; BLKSIZE= 27998
13,128K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
0 BYTES RESERVE REQUESTED, 100K BYTES USED
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Feb 20, 2012 12:50 am
Reply with quote

NO... Your step is abending with a
SYSTEM COMPLETION CODE=0C4 REASON CODE=00000004
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Mon Feb 20, 2012 1:48 am
Reply with quote

Yes ,

is there a solution
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 20, 2012 2:57 am
Reply with quote

Can you show us what is in the JNF1CNTL and JNF2CNTL files form your JCL, please?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Feb 20, 2012 3:01 am
Reply with quote

the topic is getting out of hand... ( 40 posts, it looks like one of the longer topic around )
most probably will be locked shortly and delete after a while ...
no reason to clutter the forum with such a useless back and forth of useless info icon_evil.gif
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Mon Feb 20, 2012 3:04 am
Reply with quote

JCL we are using is

Code:

//SORTJNF1 DD DSN=*******,DISP=SHR     
//SORTJNF2 DD DSN=********,DISP=SHR     
//MATCHES  DD DSN=BPV380.E11,DISP=(NEW,CATLG,DELETE),                 
//           DATACLAS=MB001,                                         
//           DCB=(RECFM=VB,LRECL=3313)                               
//NOMATCH1 DD DSN=BPV380.E12,DISP=(NEW,CATLG,DELETE),                 
//           DATACLAS=MB001,                                         
//           DCB=(RECFM=VB,LRECL=3313)                               
//SYSIN   DD *               
JOINKEYS FILES=F1,FIELDS=(5,1000,A)   
JOINKEYS FILES=F2,FIELDS=(5,1000,A)   
JOIN UNPAIRED,F1                       
REFORMAT FIELDS=(F1:1,4,F2:1,4,F1:5)   
OPTION COPY                           
OUTFIL FNAMES=NOMATCH1,               
INCLUDE=(5,2,CH,EQ,X'0000'),           
OUTREC=(1,4,9)                         
 OUTFIL FNAMES=MATCHES,               
  INCLUDE=(5,2,CH,NE,X'0000'),         
  OUTREC=(1,4,9)                                                               
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 20, 2012 4:56 am
Reply with quote

Are you sure you don't have records of less than 1008 bytes? I don't know what that would do (maybe just an A message from Syncsort), so it is a stab. A joinkeys uses more storage than a norrmal sort, because each of the joinkeys is a sub-task to the main task. You've been coy about your EXEC card, but do you have a REGION=0M around anywhere?

Triple-check everything. If still nothing, take it to your support. If they get nowhere. take it to Syncsort.
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Mon Feb 20, 2012 5:08 am
Reply with quote

Hi Bill ,


Thanks For Your Extensive support , As for as My requirement is to match keys of 5-1000 , i ran with Region parameter also....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
Search our Forums:

Back to Top