Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us