View previous topic :: View next topic
|
Author |
Message |
prarthana
New User
Joined: 12 Mar 2006 Posts: 21
|
|
|
|
Hi,
I'm a new to this gp and mainframes
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 |
|
|
rohit jaiswal Warnings : 2 New User
Joined: 09 Mar 2006 Posts: 36 Location: hyderabad,A.P
|
|
|
|
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 |
|
|
Vidusha
New User
Joined: 01 Feb 2006 Posts: 20 Location: Chennai
|
|
|
|
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 |
|
|
prarthana
New User
Joined: 12 Mar 2006 Posts: 21
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
prarthana
New User
Joined: 12 Mar 2006 Posts: 21
|
|
|
|
Thank you Frank |
|
Back to top |
|
|
|