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

Help on a File comparision and Updation


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

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Fri Jul 20, 2012 7:27 pm
Reply with quote

Hi All,

Can anyone please help me out for a file comparision and updation,

File - 1
********
Type - VB, LRECL=2000

File - 2
********
Type - VB, LRECL = 80

Output File
***********
Type - VB, LRECL=2000

Condition
*********

1) It need to pull all the records from File - 1 to the output file where the content of 1 to 8 position of file-2 matches with position from 10 to 8 character of file-1.

2) The output file should be formatted for the fetched records with below condition,
a) If the value in position 155 to 1 character is Space, then the value at 155 position needs to update that with Y.
b) If the value in position 180 to 5 character is Space, then the value at 180 position needs to update that with XXXXX.
c) If the value in position 500 to 1 character is Space, then then the value at 500 position needs to update that with Z.
d) If the value in position 1000 to 1 character is Space, then then the value at 1000 position needs to update that with Z.
e) If the value in position 3 is 0, then update the position from 750 to 6 character as PPPPPP. (Even if previously in that field we have some value)
f) If the value in position 3 is 1, then update the position from 750 to 6 character as QQQQQQ. (Even if previously in that field we have some value)

Thanks in advance.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 20, 2012 8:55 pm
Reply with quote

Hello,

If you search in this part of the forum (DFSORT) there are many examples of JOINKEYS (which will match the files as you want) and then use IFTHEN to change the values you want to change.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jul 20, 2012 10:50 pm
Reply with quote

niki,

Use the following DFSORT JCL . Since your input files are VB you need to add 4 bytes of RDW to the start positions of the fields you mentioned.


Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//INA      DD DISP=SHR,DSN=Your Input VB 2000 Lrecl file
//INB      DD DISP=SHR,DSN=Your Input VB 80 Lrecl file 
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  OPTION COPY                                       
  JOINKEYS F1=INA,FIELDS=(14,8,A)                   
  JOINKEYS F2=INB,FIELDS=(05,8,A)                   
  REFORMAT FIELDS=(F1:1,4,5)                       
                                                   
  INREC IFTHEN=(WHEN=(0007,1,CH,EQ,C'0'),           
       OVERLAY=(0754:C'PPPPPP'),HIT=NEXT),         
  IFTHEN=(WHEN=(0007,1,CH,EQ,C'1'),                 
       OVERLAY=(0754:C'QQQQQQ'),HIT=NEXT),         
  IFTHEN=(WHEN=(0159,1,CH,EQ,C' '),                 
       OVERLAY=(0159:C'Y'),HIT=NEXT),               
  IFTHEN=(WHEN=(0184,5,CH,EQ,C' '),                 
       OVERLAY=(0184:C'XXXXX'),HIT=NEXT),           
  IFTHEN=(WHEN=(0504,1,CH,EQ,C' '),                 
       OVERLAY=(0504:C'Z'),HIT=NEXT),               
  IFTHEN=(WHEN=(1004,1,CH,EQ,C' '),                 
       OVERLAY=(1004:C'Z'))                         
//*
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top