Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

File comparision and Update

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Mon Jan 31, 2011 6:41 pm    Post subject: File comparision and Update
Reply with quote

Requirement:
---------------
I have 2 input files:

1st Input File-> LRECL=9000, RECFM=VB
10 to 26 Position is KEY1
30 to 37 Position is KEY2
40 to 41 Position is VAR1
Depending upon the VAR1, the values will be stored starting from 45 position after every 10 postion.

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
9999999991234567890123456719AKEY000019901052$1001ABCDE                 
99999999923456789012345678   KEY000029900052                           
9999999994567890123456789018SKEY000049903052$1283ASAAS$1231GSHSA$9362JSSDS
999999999567890123456789011DSKEY000059902052$9312FDSFD$4321DXVDA       



2nd Input File-> LRECL=80, RECFM=FB.
1 to 17 Position is KEY1
20 to 27 Position is KEY2
28 to 32 Position is VAL1
33 to 37 Position is VAL2

We can have more than one record for a set of KEy1 and Key2. The maximum can be of 50 records for each set.

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
1234567890123456759KEY00001$1023SDGYR                                   
1234567890123456716KEY00001$1234ASBDF                                   
1234567890123456714KEY00001$1563JHKYR                                   
23456789012345678GHKEY00002$3463DYYIR                                   
56789012345678901ETKEY00005$4565DDSFR                                   
56789012345678901ETKEY00005$7895BXCJR                                   



Output File-> LRECL=9000, RECFM=VB.

The output file should look like below,

Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9
9999999991234567890123456719AKEY000019904052$1001ABCDE$1023SDGYR$1234ASBDF$1563JHKYR 
99999999923456789012345678   KEY000029901052$3463DYYIR                 
9999999994567890123456789018SKEY000049903052$1283ASAAS$1231GSHSA$9362JSSAA
999999999567890123456789011DSKEY000059904052$9312FDSFD$4321DXVDA$4565DDSFR$7895BXCJR




Condition
*********

It need to read the file 2 record by record and get the count of records for each set.

for e.g - for the set 1234567890123456759KEY00001 we have 3 records.

So for file 1 we need to update like below,

a) Position 40 to 41 = File 1 value + count got from File 2 = 01 + 3= 4.
b) get the value from pos 28th to 37th from file 2 and update one by one in the File 1.

If we dont have any entry in file 2 for the key values then no need to update anything in file 1.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Tue Feb 01, 2011 5:38 am    Post subject: Reply to: File comparision and Updation
Reply with quote

Niki,

The following DFSORT JCL will give you the desired results. I assumed that your FB file is already sorted on the key


Code:

//STEP0100 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//INA      DD DSN=Your input VB 9000 byte file,DISP=SHR
//INB      DD DSN=Your input FB 80 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*,RECFM=VB               
//SYSIN    DD *                               
  OPTION COPY                                 
  JOINKEYS F1=INA,FIELDS=(14,17,A,34,8,A)     
  JOINKEYS F2=INB,FIELDS=(01,17,A,18,8,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F1                           
  REFORMAT FIELDS=(F1:1,4,?,F2:26,502,F1:5)   
                                             
  OUTREC IFOUTLEN=9000,IFTHEN=(WHEN=(5,1,CH,EQ,C'1'),BUILD=(1,4,508)), 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,00),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,003,6,500,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,01),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,013,6,490,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,02),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,023,6,480,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,03),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,033,6,470,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,04),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,043,6,460,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,05),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,053,6,450,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,06),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,063,6,440,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,07),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,073,6,430,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,08),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,083,6,420,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,09),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,093,6,410,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,10),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,103,6,400,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,11),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,113,6,390,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,12),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,123,6,380,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,13),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,133,6,370,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,14),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,143,6,360,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,15),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,153,6,350,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,16),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,163,6,340,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,17),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,173,6,330,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,18),BUILD=(1,4,508,39,   
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,183,6,320,1052)),                 
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,19),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,193,6,310,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,20),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,203,6,300,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,21),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,213,6,290,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,22),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,223,6,280,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,23),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,233,6,270,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,24),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,243,6,260,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,25),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,253,6,250,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,26),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,263,6,240,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,27),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,273,6,230,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,28),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,283,6,220,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,29),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,293,6,210,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,30),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,303,6,200,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,31),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,313,6,190,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,32),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,323,6,180,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,33),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,333,6,170,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,34),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,343,6,160,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,35),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,353,6,150,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,36),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,363,6,140,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,37),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,373,6,130,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,38),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,383,6,120,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,39),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,393,6,110,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,40),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,403,6,100,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,41),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,413,6,090,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,42),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,423,6,080,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,43),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,433,6,070,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,44),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,443,6,060,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,45),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,453,6,050,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,46),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,463,6,040,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,47),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,473,6,030,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,48),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,483,6,020,1052)),               
  IFTHEN=(WHEN=(5,1,CH,EQ,C'B',AND,547,2,ZD,EQ,49),BUILD=(1,4,508,39, 
  547,2,ZD,ADD,506,2,BI,EDIT=(TT),549,493,6,010,1052))                 
//*                                                                   
//JNF2CNTL DD *                                                 
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,17,20,8,500Z,X'0001',28,10)),
  IFTHEN=(WHEN=INIT,OVERLAY=(538:SEQNUM,3,ZD,RESTART=(1,25))),   
  IFTHEN=(WHEN=(538,3,ZD,EQ,01),OVERLAY=(026:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,02),OVERLAY=(036:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,03),OVERLAY=(046:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,04),OVERLAY=(056:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,05),OVERLAY=(066:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,06),OVERLAY=(076:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,07),OVERLAY=(086:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,08),OVERLAY=(096:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,09),OVERLAY=(106:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,10),OVERLAY=(116:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,11),OVERLAY=(126:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,12),OVERLAY=(136:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,13),OVERLAY=(146:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,14),OVERLAY=(156:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,15),OVERLAY=(166:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,16),OVERLAY=(176:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,17),OVERLAY=(186:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,18),OVERLAY=(196:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,19),OVERLAY=(206:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,20),OVERLAY=(216:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,21),OVERLAY=(226:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,22),OVERLAY=(236:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,23),OVERLAY=(246:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,24),OVERLAY=(256:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,25),OVERLAY=(266:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,26),OVERLAY=(276:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,27),OVERLAY=(286:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,28),OVERLAY=(296:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,29),OVERLAY=(306:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,30),OVERLAY=(316:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,31),OVERLAY=(326:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,32),OVERLAY=(336:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,33),OVERLAY=(346:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,34),OVERLAY=(356:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,35),OVERLAY=(366:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,36),OVERLAY=(376:528,10)),           
  IFTHEN=(WHEN=(538,3,ZD,EQ,37),OVERLAY=(386:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,38),OVERLAY=(396:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,39),OVERLAY=(406:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,40),OVERLAY=(416:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,41),OVERLAY=(426:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,42),OVERLAY=(436:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,43),OVERLAY=(446:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,44),OVERLAY=(456:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,45),OVERLAY=(466:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,46),OVERLAY=(476:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,47),OVERLAY=(486:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,48),OVERLAY=(496:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,49),OVERLAY=(506:528,10)),             
  IFTHEN=(WHEN=(538,3,ZD,EQ,50),OVERLAY=(516:528,10))             
                                                                   
  SUM FIELDS=(026,8,034,2,036,8,044,2,046,8,054,2,056,8,064,2,     
              066,8,074,2,076,8,084,2,086,8,094,2,096,8,104,2,     
              106,8,114,2,116,8,124,2,126,8,134,2,136,8,144,2,     
              146,8,154,2,156,8,164,2,166,8,174,2,176,8,184,2,     
              186,8,194,2,196,8,204,2,206,8,214,2,216,8,224,2,     
              226,8,234,2,236,8,244,2,246,8,254,2,256,8,264,2,     
              266,8,274,2,276,8,284,2,286,8,294,2,296,8,304,2,     
              306,8,314,2,316,8,324,2,326,8,334,2,336,8,344,2,     
              346,8,354,2,356,8,364,2,366,8,374,2,376,8,384,2,     
              386,8,394,2,396,8,404,2,406,8,414,2,416,8,424,2,     
              426,8,434,2,436,8,444,2,446,8,454,2,456,8,464,2,     
              466,8,474,2,476,8,484,2,486,8,494,2,496,8,504,2,     
              506,8,514,2,516,8,524,2,526,2),FORMAT=BI             
//*
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Wed Feb 02, 2011 4:54 pm    Post subject: Reply to: File comparision and Update
Reply with quote

Hi Skolusu,

Thanks for your reply.

I was going through the code but it would be really helpful if you explain the code in brief.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 02, 2011 5:39 pm    Post subject:
Reply with quote

12.gif 12.gif 12.gif 12.gif 12.gif 12.gif 12.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Feb 02, 2011 10:40 pm    Post subject: Re: Reply to: File comparision and Update
Reply with quote

Niki wrote:
Hi Skolusu,

Thanks for your reply.

I was going through the code but it would be really helpful if you explain the code in brief.


Niki,

JNF2CNTL is taking the records and grouping them as single record with all the possible values for each key( max of 50 values)
Code:

Key1 val1
Key1 val2
key1 val3

Using INREC it will be translated to
Code:

KEY1  VAL1                   01
KEY1          VAL2           01
KEY                   VAL3   01


Using the binary code summing trick we get all the values on a single line like this
Code:

Key1 val1 val2 val3 03


Now we match the file 1 key with file 2 key and create a temp record like
Code:

RDW of File 1 + Match Indicator + 502 bytes from File 2 + variable length records of File 1


Now using another set of IFTHEN statements we validate the count field in FILE1 and move the file 2 values appropriately.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us