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
 
Combining Files using DFSORT

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

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Wed Feb 13, 2008 8:54 am    Post subject: Combining Files using DFSORT
Reply with quote

The first file will have one record and the content vary each time.The Second file will have records and the record position in this need to be changed.

File 1:
sssssssss

File 2:
123456789
abcdefghij

o/p File:
sssssssss
123 456 789
abc def ghij

In the o/p file the records in the second file need to be given a space.
Back to top
View user's profile Send private message

rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 195
Location: india

PostPosted: Wed Feb 13, 2008 9:12 am    Post subject:
Reply with quote

hi ksathishkumar83,

Quote:
In the o/p file the records in the second file need to be given a space


Well is this space in between the records of second file is after every 3rd char. ?
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Wed Feb 13, 2008 9:16 am    Post subject: Reply to: Merge Files
Reply with quote

it is only for the first thre occurence,Remaining colums should be copied as it is.
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: Wed Feb 13, 2008 10:04 pm    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
sssssssss
/*
//IN2 DD *
123456789
abcdefghij
/*
//***>>> USE MOD FOR THE //OUT DD DATA SET
//OUT DD DISP=(MOD,CATLG,DELETE),DSN=...  output file (FB/82)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
  INREC OVERLAY=(82:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,3,X,4,3,X,7,74)
/*
Back to top
View user's profile Send private message
ksathishkumar83

New User


Joined: 21 Nov 2006
Posts: 50
Location: India

PostPosted: Sat Feb 16, 2008 12:47 am    Post subject: Reply to: Combining Files using DFSORT
Reply with quote

hi,

i did by the below sort using ICETOOL

//Step1 EXEC ICETOOL
//inp1 dd *
ssssssssss
//inp2 dd *
1234567890918744
//temp dd dsn=&&temp,disp=(mod,pass,delete)
//out dd dsn=fileq
//toolin dd *
copy from(inp1) to (temp)
copy from(inp2) to(temp) using CTL1
copy from(temp) to (out)
//ctl1ctln dd *
outrec fields=(1:1,3,5:4,3,9:7.3.........)
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

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