Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us