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
 
File Manipulation using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Mon Nov 24, 2008 3:58 pm    Post subject: File Manipulation using DFSORT
Reply with quote

Hi All,

I have two files as below.

File 1 Content

AAA BBB CCC
AAA EEE FFF
AAA GGG HHH
GGG HHH III

File 2 Content

XXX
YYY
ZZZ
WWW


I want my output file should be as below

AAA BBB CCC XXX
AAA BBB CCC YYY
AAA BBB CCC ZZZ
AAA BBB CCC WWW
AAA EEE FFF XXX
AAA EEE FFF YYY
AAA EEE FFF ZZZ


Is the above operation possible with DFSORT.


Thanks,
Abhishek
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: Mon Nov 24, 2008 10:47 pm    Post subject:
Reply with quote

It's not clear what you want to do. You need to explain the "rules" more clearly.

Do you want to append the fields from the file2 records to the fields from the file1 records one-by-one, for example, append XXX to the first file1 record fields, append YYY to the second file1 record fields, append ZZZ to the third file1 record fields, append WWW to the fourth file1 record fields, append XXX to the fifth file1 record fields, and so on?

Or do you want to append fields depending on a key? If so, which field is the key and what do you want to do exactly?

Or do you want to do something else?

Does file2 always have 4 records or can it have more or less records?

What is the RECFM and LRECL of each input file?
Back to top
View user's profile Send private message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Tue Nov 25, 2008 9:09 am    Post subject:
Reply with quote

Hi Frank,

I want File2 content to be appended to File1. For eg:
XXX appended to first record in File1 i.e AAA BBB CCC
YYY appended again to AAA BBB CCC
ZZZ appended again to AAA BBB CCC & so on.

I can say the File2 will have only 4 records
Record format of each file is fixed and Logical Rec length is 80.



Thanks,
Abhishek
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: Tue Nov 25, 2008 9:39 pm    Post subject:
Reply with quote

You can use a DFSORT job like the one below to do what I think you asked for.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *   input file2 (FB/80)
XXX
YYY
ZZZ
WWW
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'CON',SEQNUM,1,ZD,C',''',1,3,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *   input file1 (FB/80)
AAA BBB CCC
AAA EEE FFF
AAA GGG HHH
GGG HHH III
/*
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL BUILD=(1,12,CON1,80:X,/,1,12,CON2,/,1,12,CON3,/,
    1,12,CON4)
/*


The SORTOUT from step S2 would have these records:

Code:

AAA BBB CCC XXX   
AAA BBB CCC YYY   
AAA BBB CCC ZZZ   
AAA BBB CCC WWW   
AAA EEE FFF XXX   
AAA EEE FFF YYY   
AAA EEE FFF ZZZ   
AAA EEE FFF WWW   
AAA GGG HHH XXX   
AAA GGG HHH YYY   
AAA GGG HHH ZZZ   
AAA GGG HHH WWW   
GGG HHH III XXX   
GGG HHH III YYY   
GGG HHH III ZZZ   
GGG HHH III WWW   
Back to top
View user's profile Send private message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Wed Nov 26, 2008 10:07 am    Post subject:
Reply with quote

Thanks Frank for the solution..its working good..



Thanks,
Abhishek
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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