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

To SPLICE two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Mon Mar 13, 2006 12:01 am
Reply with quote

Hi,
I'm a new to this gp and mainframes icon_smile.gif
My req: I have two input files

File A:

H1234
AAAAAAAAAA12345654567
BBBBBBBBBB23456674579
T1234

File B:

H1234
AAAAAAAAAA67899005667
BBBBBBBBBB45835457854
T1234


Now my output file should eliminate records with H& T in the first position.
And the output file should have this

12345654567
23456674579
67899005667
45835457854

(i.e starting from the 11th position, i need to extract 11 chars from each of the input file)

Can someone give me the JCL for this?

Thanks.
Back to top
View user's profile Send private message
rohit jaiswal
Warnings : 2

New User


Joined: 09 Mar 2006
Posts: 36
Location: hyderabad,A.P

PostPosted: Mon Mar 13, 2006 11:46 am
Reply with quote

hi prarthana,

wat i have understood from your query is that u need to extract data from the 11th byte from the input file n doesnt want the characters H and T.

u can do this directly in ur code try to extract data from the position u need.i mean do it as follows

<field name>(starting position:length of the field)=<field name> this can be deone thru cobol pgm.

from jcl u can use the sort utiliy.

if u want to know the entire jcl pls tell me.
Back to top
View user's profile Send private message
Vidusha

New User


Joined: 01 Feb 2006
Posts: 20
Location: Chennai

PostPosted: Mon Mar 13, 2006 12:39 pm
Reply with quote

Hi Prarthana,

Here is one method...
Code:

//SORT01    EXEC PGM=SORT                                           
//SORTIN    DD DSN=FILE.SORTIN1,DISP=SHR             
//               DD DSN=FILE.SORTIN2,DISP=SHR             
//SORTOUT DD DSN=FILE.SORTOUT,DISP=(NEW,CATLG),     
//               ...............               
//SYSIN     DD *                                                 
    OPTION COPY                                                   
    OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')             
    OUTREC FIELDS=(11,11)                                         
//SYSOUT    DD SYSOUT=*                                           


Thanks
Vidusha
Back to top
View user's profile Send private message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Mon Mar 13, 2006 8:47 pm
Reply with quote

Thanks for the reply..but my two input files are of type FB and of different length..this code wont work for this right? Its throwing me an error
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Mar 13, 2006 8:56 pm
Reply with quote

prarthana wrote:
..but my two input files are of type FB and of different length..

prarthana, why didn't you mention that in your original post? You need to post your input dataset LRECL and RECFM atributes, as well as what you need for your output dataset.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Mar 13, 2006 10:22 pm
Reply with quote

prarthana,

Here's a DFSORT/ICETOOL job that will do what you asked for. Note that OUT must be a MOD data set.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//OUT DD DISP=MOD,DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')
  OUTREC FIELDS=(11,11)
/*
Back to top
View user's profile Send private message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Tue Mar 14, 2006 1:35 am
Reply with quote

Thank you Frank
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
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
Search our Forums:

Back to Top