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
 

 

Append fields to end of a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Append fields to end of a file
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    Post subject: Reply to: Append fields to end of a file
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: 1703
Location: Australia

PostPosted: Thu Aug 06, 2009 5:57 pm    Post subject:
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: 2284
Location: @my desk

PostPosted: Fri Aug 07, 2009 11:28 am    Post subject:
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    Post subject: Reply to: Append fields to end of a file
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    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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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