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
 
Add a field from one file to a second file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Fri Nov 24, 2006 5:17 pm    Post subject: Add a field from one file to a second file
Reply with quote

Hi,

I have 2 files of different record lengths. The second file has just one record. I want to append the contents of the second file to all records of the first file.

Can this be done directly using SYNCSORT?

Thanks in Advance,
Aneesh.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 24, 2006 9:34 pm    Post subject:
Reply with quote

You can do this with DFSORT, but you need to give more information about what you're trying to do. Please show an example of the records in file1 and the record in file2 and what you expect for the output records. Please give the RECFM and LRECL of each input file.
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Sat Nov 25, 2006 11:56 am    Post subject: Re: Add a field from one file to a second file
Reply with quote

The first file is of 80 bytes(FB) - it has a list of transaction data. The second file is a parm file of 13 bytes (FB) and has the last run date and day(2006-11-24Fri).

The requirement is to append the second file data to the end of every record in the first file.
File1:
Trans1XXXX.....XXX
Trans2XXXX.....XXX
...
File2:(One record only)
2006-11-24Fri

Required output:(the length of the file will be 80 + 13 = 93)
Trans1XXXX.....XXX2006-11-24Fri
Trans2XXXX.....XXX2006-11-24Fri
...

Hope this makes it clear.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Nov 25, 2006 9:07 pm    Post subject:
Reply with quote

Aneesh,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file2 (FB/13) - date record
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT symbol as follows:
* Mydate,'yyyy-mm-ddday'
  OUTREC BUILD=(C'Mydate,''',1,13,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=..  input file1 (FB/80) - transactions
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
* Use Mydate to add date at end of records.
  INREC OVERLAY=(81:Mydate)
/*
Back to top
View user's profile Send private message
Aneesh

New User


Joined: 30 Sep 2006
Posts: 60

PostPosted: Mon Nov 27, 2006 8:55 am    Post subject: Re: Add a field from one file to a second file
Reply with quote

Thanks a lot, Frank.
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

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