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

how get this function?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
LinkinPark
Warnings : 1

New User


Joined: 20 Nov 2005
Posts: 44
Location: DALIAN,CHINA

PostPosted: Sat Feb 25, 2006 3:56 pm
Reply with quote

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
View user's profile Send private message
antonrino.b

New User


Joined: 10 Jan 2006
Posts: 76
Location: Germany

PostPosted: Sat Feb 25, 2006 5:09 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Feb 25, 2006 9:37 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
No new posts INSYNC option with same function as I... JCL & VSAM 0
Search our Forums:

Back to Top