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
 

 

To SPLICE two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To SPLICE two files
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    Post subject:
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    Post subject:
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    Post subject: Re: To SPLICE two files
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

Moderator Team Head


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

PostPosted: Mon Mar 13, 2006 8:56 pm    Post subject: Re: To SPLICE two files
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 Moderator


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

PostPosted: Mon Mar 13, 2006 10:22 pm    Post subject:
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    Post subject:
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    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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
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