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

Reformating output from two files using syncsort


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

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Feb 12, 2009 7:15 pm
Reply with quote

Hi,

I m having two flat files.The contents from these two files have to be merged as

FILE A:
XXXX YYYY ZZZZ
AAAA BBBB CCCC

FILE B
10/12/1984

Note: File B always contains a single record only.(ie a date value)

EXPECTED O/P:
XXXX 10/12/1984 YYYY ZZZZ
AAAA 10/12/1984 BBBB CCCC
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 12, 2009 7:18 pm
Reply with quote

Murugan,

What are the LRECL/RECFM of your input and output files?
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Feb 12, 2009 7:25 pm
Reply with quote

FILE A:

LRECL=17
RECFM=FB

FILE 8:

LRECL=10
RECFM=FB
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 12, 2009 8:44 pm
Reply with quote

What about Output file LRECL?
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Sat Feb 14, 2009 12:41 am
Reply with quote

Arun,

Quote:
What about Output file LRECL


LRECL=10
RECFM=FB

I tried the following way and got the desired o/p.Is there any other way
to achieve the desired o/p.Let me know ur thoughts about this.

In file A & file B I appended a string 'MATCH'.

Ex
File A:
=====
field1 field2 field3 field4
XXXX YYYY ZZZZ MATCH
AAAA BBBB CCCC MATCH

File B:
=====
field1 field2
10/12/1984 MATCH

Then i did a sort join on the string 'MATCH' and reformatted to get
the desired o/p.
XXXX 10/12/1984 YYYY ZZZZ
AAAA 10/12/1984 BBBB CCCC
It works fine.







[/quote]
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Feb 14, 2009 2:17 am
Reply with quote

Murugan L,

You can have the date-value in a PS file of FB/LRECL=80 and use it as a SYMNAMES dataset like this. I am away from office now and cant test this now. Try and post back if you come across any issues.
Code:
DATE-P,'10/12/1984'
Code:
//STEP1    EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                               
//SYMNAMES DD DSN= date-file   -- FB/LRECL=80         
//SORTIN   DD DSN= Input  file -- FB/LRECL=17                   
//SORTOUT  DD DSN= Output file -- FB/LRECL=25               
//SYSIN   DD *                                       
  OPTION COPY
  INREC BUILD=(1,5,DATE-P,17:6,9)
/*
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Mon Feb 16, 2009 11:25 am
Reply with quote

Arun,

I have mentioned the wrong o/p LRECL.
Quote:
LRECL=10
RECFM=FB


It has to be 27.Sorry for the confusion.

But i tried the above said code it is working fine...

Thanks a lot!!!
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Feb 16, 2009 1:07 pm
Reply with quote

You're welcome. Glad to hear that it worked for you. icon_smile.gif
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top