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
 

 

SORT - 2 files and generate one file -override one parameter

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

New User


Joined: 30 Sep 2008
Posts: 30
Location: India

PostPosted: Fri Oct 24, 2008 11:17 am    Post subject: SORT - 2 files and generate one file -override one parameter
Reply with quote

Hi,

I have two input files and I have to generate third output file. Requirement is as below.

From 11th to 12th charecters of the second input file need to be replaced with 1th to 12th charecters of the first input file - and generate the third output file

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

bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 210
Location: Cochin/Kerala/India

PostPosted: Fri Oct 24, 2008 11:34 am    Post subject:
Reply with quote

Hi mohanrazz,
Your requirement is not much clear.What you mean by "From 11th to 12th charecters of the second input file need to be replaced with 1th to 12th charecters of the first input file".
Replace the character if the two files have a common key? or
To replace the character in the 1 record in first file with 1st record in second file..2 record in 1st file 2nd record in 2nd file.... is it like that?
Back to top
View user's profile Send private message
mohanrazz

New User


Joined: 30 Sep 2008
Posts: 30
Location: India

PostPosted: Fri Oct 24, 2008 11:38 am    Post subject:
Reply with quote

bipin,

first file
Code:
abcdefghij12klmnopqrst


second file
Code:
          89         


my output file should be

Code:
abcdefghij89klmnopqrst


that means 12 (11th and 12th chars of first file) are replaced by 89 (11th and 12th chars of second file) -

Pls let me know how to do that in jcl
thanks.
Back to top
View user's profile Send private message
mohanrazz

New User


Joined: 30 Sep 2008
Posts: 30
Location: India

PostPosted: Fri Oct 24, 2008 11:38 am    Post subject:
Reply with quote

Also both the files have only one record each
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Oct 24, 2008 9:04 pm    Post subject: Reply to: SORT - 2 files and generate one file -override one
Reply with quote

mohanrazz,

Use the following DFSORT JCL if both files are of the same LRECL and RECFM

Code:

//STEP0100 EXEC PGM=ICEMAN                           
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
ABCDEFGHIJ12KLMNOPQRST                               
//         DD *                                       
          89                                         
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  OPTION EQUALS,ZDPRINT                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD)), 
  IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(11:C'00')),   
  IFTHEN=(WHEN=(81,1,ZD,EQ,2),OVERLAY=(81:C'1'))     
  SORT FIELDS=(81,1,CH,A)                             
  SUM FIELDS=(11,2,ZD)                               
  OUTFIL BUILD=(1,80)                                 
/*                                                   


And if the files are of different LRECL then use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
          89                                               
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN    DD *                                           
  OPTION COPY                                             
  OUTREC BUILD=(C'SRNO,C''',11,2,C'''',80:X)               
/*                                                         
//STEP0200 EXEC PGM=ICEMAN                                 
//SYMNAMES DD DSN=&&T1,DISP=SHR                           
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
ABCDEFGHIJ12KLMNOPQRST                                     
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  OPTION COPY                                             
  INREC OVERLAY=(11:SRNO)                                 
/*   
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm


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