IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Append fields to end of a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Thu Aug 06, 2009 5:28 pm
Reply with quote

Hi

In JCL, I have two files one is of LRECL 90 and other is of LRECL 10.

FILE1 - LRECL 90(100 Records)
FILE2 - LRECL 10(1 Record)

I have to generate FILE 3 - LRECL (90(File1) + 10(File2))

How do I do it?

Code:
File 1
IamFile1
IamFile1
IamFile1

File2:
IamFile2

File3:
IamFile1IamFile2
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Thu Aug 06, 2009 5:45 pm
Reply with quote

I made a mistake it should be
Code:

File 1
IamFile1
IamFile1
IamFile1

File2:
IamFile2

File3:
IamFile1IamFile2
IamFile1IamFile2
IamFile1IamFile2
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Aug 06, 2009 5:57 pm
Reply with quote

Hi,

try this
Code:
//S1       EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=   input FILE2                                       
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)         
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  INREC BUILD=(C'ADDME,''',1,10,C'''',80:X)                             
/*                                                                     
//S2       EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                                 
//SORTIN   DD DSN=  input FILE1                                       
//SORTOUT  DD SYSOUT=*      FILE3                                           
//SYSIN    DD *                                                         
  OPTION COPY                                                           
  OUTREC BUILD=(1,90,ADDME)                                             


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Aug 07, 2009 11:28 am
Reply with quote

HameedAli,

If you have a common-key in your 'real-file' similar to the one shown in your sample data (say pos-1 in both the files='I' in your sample), you can achieve this using a simple SyncSort JOIN application like this.
Code:
//STEP1  EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*             
//SORTJNF1 DD DSN= Input1         
//SORTJNF2 DD DSN= Input2         
//SORTOUT  DD DSN= Output         
//SYSIN    DD *                   
  JOINKEYS FILE=F1,FIELDS=(1,1,A) 
  JOINKEYS FILE=F2,FIELDS=(1,1,A) 
  REFORMAT FIELDS=(F1:1,90,F2:1,10)
  SORT FIELDS=COPY                 
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Fri Aug 07, 2009 12:24 pm
Reply with quote

It worked, Thanks a lot.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top