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: 2276
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
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am


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