|
View previous topic :: View next topic
|
| Author |
Message |
LinkinPark Warnings : 1 New User

Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
|
|
|
|
Hi ,
I have a dataset like this
| Code: |
DCTMPJPJ28 *M YYYYYYYYYYYY {
W W YYYYYYYYYYYY
MPJ2AM471PJ2/CMS J9999999999 9999 O
LPJPVPJ2.VPLUS.CTLM.JCLLIB.D%%ODATE 305
HWAKAI1 C/O IDENTIFICATION- 11TH OF MONTH
V
ZJAPANGENCTL.CTMP5.OPER.DOC
IPJPJ2-PJ2ARCB1 ODATPJPJ2-PJ2ARCB2 ODATPJPJ2-PJ2ARCB3 ODA
IPJPJ2-PJ2ARCB4 ODATPJPJ2-PJ2ARCB5 ODATPJPJ2-PJ2ARCB6 ODA
IPJPJ2-PJ2ARCB7 ODATPJPJ2-PJ2ARCB8 ODATPJPJ2-PJ2ARCB9 ODA
IPJPJ2-PJ2ARDR1 ODATPJPJ2-PJ2ARDR2 ODATPJPJ2-PJ2ARDR3 ODA
IPJPJ2-PJ2ARDR4 ODATPJPJ2-PJ2ARDR5 ODATPJPJ2-PJ2ARDR6 ODA |
I wanna get the out dataset that if above dataset'line start with "M" or
start with "I",
out dataset like this:
| Code: |
MPJ2AM471PJ2/CMS J9999999999 9999 O
IPJPJ2-PJ2ARCB1 ODATPJPJ2-PJ2ARCB2 ODATPJPJ2-PJ2ARCB3 ODA
IPJPJ2-PJ2ARCB4 ODATPJPJ2-PJ2ARCB5 ODATPJPJ2-PJ2ARCB6 ODA
IPJPJ2-PJ2ARCB7 ODATPJPJ2-PJ2ARCB8 ODATPJPJ2-PJ2ARCB9 ODA
IPJPJ2-PJ2ARDR1 ODATPJPJ2-PJ2ARDR2 ODATPJPJ2-PJ2ARDR3 ODA
IPJPJ2-PJ2ARDR4 ODATPJPJ2-PJ2ARDR5 ODATPJPJ2-PJ2ARDR6 ODA |
Thanks
Chen |
|
| Back to top |
|
 |
antonrino.b
New User

Joined: 10 Jan 2006 Posts: 76 Location: Germany
|
|
|
|
| Code: |
/* REXX */
ipdsn=userid.file.input
opdsn=userid.file.output
"ALLOC DDN(IPFILE) DSN('"IPDSN"') SHR"
IF RC <> 0 THEN DO
SAY 'COULDNOT ALLOCATE "IPDSN"'
EXIT
END
"ALLOC DDN(OPFILE) DSN('"OPDSN"') SHR"
IF RC <> 0 THEN DO
SAY 'COULDNOT ALLOCATE "OPDSN"'
EXIT
END
"EXECIO * DISKR IPFILE (STEM INREC. FINIS"
j=1;
do i = 1 to inrec.0
if substr(inrec.i,1,1) = 'M' | substr(inrec.i,1,1) = 'I' then
do
outrec.j = inrec.i
j = j + 1
end
end
"EXECIO * DISKW OPFILE (STEM OUTREC. FINIS"
"FREE DDNAME(IPFILE OPFILE)" |
Hope this rexx routine will do what you needed..
Regards,
Antu |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,1,CH,EQ,C'M',OR,1,1,CH,EQ,C'I')
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|