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
 

 

Reformating output from two files using syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reformating output from two files using syncsort
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: 2276
Location: @my desk

PostPosted: Thu Feb 12, 2009 7:18 pm    Post subject:
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Thu Feb 12, 2009 8:44 pm    Post subject:
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Sat Feb 14, 2009 2:17 am    Post subject:
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    Post subject:
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: 2276
Location: @my desk

PostPosted: Mon Feb 16, 2009 1:07 pm    Post subject:
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    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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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