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
 

 

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: 188
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am


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