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
 

 

Help on a File comparision and Updation

 
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: Fri Jul 20, 2012 7:27 pm    Post subject: Help on a File comparision and Updation
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

Site Director


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

PostPosted: Fri Jul 20, 2012 8:55 pm    Post subject:
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    Post subject:
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    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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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