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
 
Overring particular postion from the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Mon May 26, 2008 11:10 am    Post subject: Overring particular postion from the file
Reply with quote

Input File1:


10000000000000000000000000000000000000000000000000000000000000000000000000000000
20000000000000000000000000000000000000000000000000000000000000000000000000000000
30033333333333333333333300330000000000000000000000000000000000000000000000000000
40044444444444444444444444440000000000000000000000000000000000000000000000000000
60000000000000000000000000000000000000000000000000000000000000000000000000000000


Input File 2:


10000000000000000000KK0000000000000000000000000000000000000000000000000000000000
20000000000000000000KK0000000000000000000000000000000000000000000000000000000000
30000000000000000000KK0000000000000000000000000000000000000000000000000000000000
40000000000000000000KK0000000000000000000000000000000000000000000000000000000000



Hi O.P File

10000000000000000000KK0000000000000000000000000000000000000000000000000000000000
20000000000000000000KK0000000000000000000000000000000000000000000000000000000000
30033333333333333333KK3300330000000000000000000000000000000000000000000000000000
40044444444444444444KK4444440000000000000000000000000000000000000000000000000000
60000000000000000000 000000000000000000000000000000000


Code:

//STEP05   EXEC PGM=SYNCSORT
//SORTJNF1 DD  DSN=File1,DISP=SHR
//SORTJNF2 DD  DSN=FILE2,DISP=SHR
//SORTOUT  DD  DSN=OUTPUTFILE,
//             DISP=(,CATLG,DELETE),
//             SPACE=(CYL,(100,100),RLSE)
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
   JOINKEYS FILES=F1,FIELDS=(1,3,A)
   JOINKEYS FILES=F2,FIELDS=(1,3,A)
   JOIN UNPAIRED
   REFORMAT FIELDS=(F2:21,2,F1:1,20,F1:23,78)


Issue:

File 1 having 5 records.. FIle 2 having 4 records

In FILE 1 and FILE 2 1st 3 character are key fields (bold letters) based on those key fields if the key fields matches in both the files override the 21st postion from the 1st file and replace it by KK( Ucan see in the o/p file ) but for the non match record should be remain same .. if you look at the p/p file u can identify spaces instead of "00"

please let me know i can retain the non matching record without alterring

Please let me know if you need more details

its syncsort product
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Mon May 26, 2008 6:42 pm    Post subject:
Reply with quote

Can you try with the below code. I just tried and this seems to be working.

Code:
   
   OPTION COPY                                               
   JOINKEYS FILES=F1,FIELDS=(1,3,A)                         
   JOINKEYS FILES=F2,FIELDS=(1,3,A)                         
   JOIN UNPAIRED,F1                                         
   REFORMAT FIELDS=(F1:1,80,F2:1,80)                         
   OUTFIL FNAMES=MYOUT                                       
   OUTREC IFTHEN=(WHEN=(101,2,CH,EQ,C'  '),                 
                     BUILD=(1,20,21,2,C'00',23,58)),         
          IFTHEN=(WHEN=(NONE),                               
                      BUILD=(1,20,101,2,23,58))   
           
Back to top
View user's profile Send private message
sanjayis01
Warnings : 1

New User


Joined: 13 Jun 2007
Posts: 55
Location: banaglore

PostPosted: Wed May 28, 2008 9:50 am    Post subject:
Reply with quote

hi Manuneedhi

Thats fine when you know what value you will get..

What if you dont know what value you will get in that pistion

So how we can resolve this?
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed May 28, 2008 11:21 am    Post subject:
Reply with quote

Sanjay,

Please check the below thread

http://ibmmainframes.com/viewtopic.php?t=31065&highlight=

The question there was almost similar to your's and my answer there should work for your case as well.

Thanks
Manu
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 -> JCL & VSAM 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