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

problem with comparing two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nkothako

Active User


Joined: 26 Nov 2008
Posts: 125
Location: chennai

PostPosted: Fri Mar 21, 2014 3:40 am
Reply with quote

My both input files are 34 bit lenth

i want to compare if inp1 (XXX-XNB, and XXX-DT ) matches with any record of INP2 file record then inp1 file XXX-XD has to write into output file ... both are same size and same format ... any help is highly appreciated

Inp1

Code:
XXX-XD XXX-XNB        XXXX-DT
           #2 #3                   #4           
       BI 1:4 AN 5:20              AN 25:10     
  <---+----1> <---+----1----+----> <---+---->   
****  Top of data  ****                         
            10 TEMP041          1837-12-31   
            20 TEMP042          1837-12-31   
            30 TEMP043          1837-12-31   


INp2
Code:
XXX-XD XXX-XNB        XXXX-DT
           #2 #3                   #4           
       BI 1:4 AN 5:20              AN 25:10     
  <---+----1> <---+----1----+----> <---+---->   
****  Top of data  ****                         
            40 TEMP041          1837-12-31   
            50 TEMP042          1837-12-31   
            60 TEMP043          1837-12-31   


Whats wrong in my code...
it created empty output dataset after running 1hr and also ended with RC 16
Code:
//PS030    EXEC PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//INP1     DD  DSN=XXX.EXTRACT.G15,DISP=SHR 
//INP2     DD  DSN=XXX.EXTRACT,DISP=SHR     
//SORTOUT  DD  DSN=XXX.ONLY.XXXID,                         
//             UNIT=SYSDA,DISP=(NEW,CATLG,DELETE),             
//             SPACE=(CYL,(4000,4000),RLSE),                   
//             DCB=(RECFM=FB,LRECL=10)                         
//SYSIN      DD *                             
  OPTION COPY                                 
  JOINKEYS F1=INP1,FIELDS=(5,20,A,25,10,A)   
  JOINKEYS F2=INP2,FIELDS=(5,20,A,25,10,A)   
  REFORMAT FIELDS=(F1:1,04)                   
/*                                           


Code tags corrected - need [/code] to close
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: Fri Mar 21, 2014 4:49 am
Reply with quote

You need to post the sysout from the failed step.

From the space allocated to your output, it looks like you have a lot of input records.

Does it work when you run it with your test files?

You'll need to make a better description of the process, with sample data, and expected results. If you can show the samples as records rather than as displayed on some screen, it would help.

Are the files in sequence already? At the moment you are SORTing both of input files. Do you need to do that?
Back to top
View user's profile Send private message
nkothako

Active User


Joined: 26 Nov 2008
Posts: 125
Location: chennai

PostPosted: Fri Mar 21, 2014 5:21 am
Reply with quote

Quote:

You'll need to make a better description of the process, with sample data, and expected results. If you can show the samples as records rather than as displayed on some screen, it would help.


ans: please find the above input files

And my expected output records are from Inp1 XXX-ID when there is only a matching record of both input files fields XXX-NBR and XXX-DT ...
10
20
30

Quote:

Are the files in sequence already? At the moment you are SORTing both of input files. Do you need to do that?


Ans : Files are sorted already. no need to sort them

Quote:

From the space allocated to your output, it looks like you have a lot of input records.

yes

Quote:
You need to post the sysout from the failed step


Code:
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2                 
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR INP1     - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR INP2     - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=4                                     
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE751I 0 C5-K76982 C6-K90026 C7-K94453 C8-K94453 E9-K60824 C9-BASE   E5-K80744
ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 16:12 ON THU MA
            OPTION COPY                                                         
            JOINKEYS F1=INP1,FIELDS=(5,20,A,25,10,A)                           
            JOINKEYS F2=INP2,FIELDS=(5,20,A,25,10,A)                           
            REFORMAT FIELDS=(F1:1,04)                                           
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS         
ICE089I 0 XXXX.PS030   .        , INPUT LRECL = 4, TYPE = F   
ICE252I 1 PARMLIB OPTIONS WERE MERGED WITH INSTALLATION MODULE DEFAULTS         
ICE089I 0 XXXX.PS030   .        , INPUT LRECL = 4, TYPE = F                 
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)                                 
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6189040,6189040)                           
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=NONE,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=256 ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y                                         
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT                                   
ICE805I 1 JOBNAME: XXXX , STEPNAME: PS030                                   
ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                     
ICE889I 0 CT=MAX     , SB=8, L=0, D=0000, CCW=1MAM                             
ICE889I 0 CT=MAX     , SB=8, L=0, D=0000, CCW=1MAM                 
ICE902I 0 O PP10  I                                               
ICE039A 1 INSUFFICIENT MAIN STORAGE - ADD AT LEAST 28K BYTES       
ICE751I 1 EF-BASE   E8-K94453                                     
ICE052I 0 END OF DFSORT                                           


Quote:

Does it work when you run it with your test files?
Currently Running in test env
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Mar 21, 2014 5:35 am
Reply with quote

Did you check "ICE039A 1 INSUFFICIENT MAIN STORAGE - ADD AT LEAST 28K BYTES " message?

Here are the reasons and probable solutions,

1) ibmmainframes.com/about53372.html

2) www-01.ibm.com/support/docview.wss?uid=isg1PK84670

3) ibmmainframes.com/about56602.html
Back to top
View user's profile Send private message
nkothako

Active User


Joined: 26 Nov 2008
Posts: 125
Location: chennai

PostPosted: Fri Mar 21, 2014 5:54 am
Reply with quote

yep i checked and i restarted the job after that.... but next time it went successfull but no output ... wondering what is the reason...is there any problem in joinkeys or sort fields ... no idea... but I feel what i coded was correct ...
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Mar 21, 2014 6:05 am
Reply with quote

Please Cut Paste your sysout all the time when you make a try and show us the Job as well along with sample data.And I suspect none of the JOIN condition got satisfied and hence you got empty file so please check all the offsets and joins again.
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: Fri Mar 21, 2014 2:24 pm
Reply with quote

You still seem to think you want "if any key in File 1 matches any key in File 2 output all records in File 1".

If that is what you want, please explain how that would happen without you coding anything? Also, how would it happen in one step, short of having a massive cartesian join, which would be unlikely to complete any time soon?

You don't even get matched records, which is what your code should get. You haven't shown the data how I asked. We don't know (no sysout for it) the RECFM of your inputs.

You didn't explain how things went with your test file. You didn't show all the sysout from the step (perhaps you don't have DDs for the joinkeys tasks?).

If someone asks you to explain because what you have said so far is unclear, and for your new explanation you just refer to the original - what type of assistance do you feel will be forthcoming?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 21, 2014 10:15 pm
Reply with quote

nkothako wrote:
yep i checked and i restarted the job after that.... but next time it went successfull but no output ... wondering what is the reason...is there any problem in joinkeys or sort fields ... no idea... but I feel what i coded was correct ...


Read the first bullet point in here about region size when running joinkeys

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.6?

Your Reformat statement is creating a 4 byte file but your JCL has an hardcoded LRECL of 10 which is quite unnecessary as the filler bytes with binary zeros.
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 -> DFSORT/ICETOOL

 


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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top