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
 

 

how get this function?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: how get this function?
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    Post subject:
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 Moderator


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

PostPosted: Sat Feb 25, 2006 9:37 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us