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
 

 

Changing a field

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

New User


Joined: 28 Jul 2009
Posts: 3
Location: hyderabad

PostPosted: Fri Jul 31, 2009 11:16 pm    Post subject: Changing a field
Reply with quote

i have two input files
FILEA
001 999 C 01
002 888 C 02
003 777 C 03

FILEB
001 999 C 01
002 888 C 04
003 777 C 03

Here in the two input files first and second cols are the key fields

I want to change the 3rd column from C to D, only when there is a change in the change in the 4th column.

here in the 2nd record.. there is a change in 4th column.So i need to change it from C to D.

Finally i want the below record in the output file
002 888 D 04
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 31, 2009 11:32 pm    Post subject: Reply to: Changing a field
Reply with quote

bellamkondar,

1. What is the LRECL and RECFM of FILE A
2. What is the LRECL and RECFM of FILEB
3. What is the position and format of the key fields to be matched in both files?
4. What is the position of the change field?
5. Does any of the files have duplicates on the key?
Back to top
View user's profile Send private message
bellamkondar

New User


Joined: 28 Jul 2009
Posts: 3
Location: hyderabad

PostPosted: Sat Aug 01, 2009 1:09 am    Post subject:
Reply with quote

Skolusu,

1. Both files have same LRECL 200 and
2. Both files have same key pos(1-7)
3. values in position 9 - 'C' should be changed to 'D' when
there is a change in the vlaue of posion 11
4. No duplicates in both the files and
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Aug 01, 2009 3:00 am    Post subject: Reply to: Changing a field
Reply with quote

bellamkondar,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DUMMY,DCB=(LRECL=200,RECFM=FB,BLKSIZE=27800)
//SORTOUT  DD DSN=&&H,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE) 
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTFIL REMOVECC,                                         
  TRAILER1=(3C'$',11:2C'0',200:X)
//*
//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&H,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT             
//         DD DSN=Your input fileB,DISP=SHR
//         DD DSN=&&H,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT             
//         DD DSN=Your input fileA,DISP=SHR                           
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(201:ID=1)),
  IFTHEN=(WHEN=(201,1,ZD,EQ,1),OVERLAY=(202:2X'00')),                 
  IFTHEN=(WHEN=(201,1,ZD,EQ,2),OVERLAY=(202:11,2))                   
 
  SORT FIELDS=(1,7,CH,A),EQUALS                                       
  SUM FIELDS=(201,1,ZD,202,2,BI)                                     
 
  OUTFIL INCLUDE=(201,1,ZD,EQ,3,AND,11,2,CH,NE,202,2,CH),             
  BUILD=(1,8,C'D',10,191)                                             
//*
Back to top
View user's profile Send private message
bellamkondar

New User


Joined: 28 Jul 2009
Posts: 3
Location: hyderabad

PostPosted: Sat Aug 01, 2009 11:13 am    Post subject:
Reply with quote

Thanks Skolusu...

If i have two keys say from pos(1-3) and pos(4-7)...then how can i use those two keys in the sort.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Aug 03, 2009 9:58 pm    Post subject:
Reply with quote

bellamkondar,

Unless the 2 keys are of different format , there is no difference in treating them as a single key since they are right next to each.

Are the 2 keys of different format?
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 BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 1 Tue Jul 25, 2017 12:12 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


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