View previous topic :: View next topic
|
Author |
Message |
Raj24186
New User
Joined: 04 May 2010 Posts: 9 Location: Chennai
|
|
|
|
Hi,
I have a requirement, wherein I have a PS. This PS in turn contains few records that are actually sequential file names. I need to write a JCL to browse these files and search for a particular string at a position and display the same along with the filename.
To be more elaborate:
My PS: xxx.yyy.zz contains the following records(which are in turn filenames):
aa.bbb.ccc
dd.eee.fff
ggg.hh.ii
As mentioned i want to search for a string in these files. My output should display the filename along with the string. For eg. i am searching for "L134" in those 3 datasets, my output should be as follows:
aa.bbb.ccc L1234
ggg.hh.ii L1234
Please let me know how this can be achieved using JCL?
Thanks,
Rajesh. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
SAS could do the job. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Raj24186 wrote: |
Please let me know how this can be achieved using JCL? |
It can not be done using JCL
/RANT ON
Once more let us clarify exactly what JCL is.
it is Job Control Language.
By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.
JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF
So, if you might just care to tell us which program you wish the JCL to execute, we might be able to help you
As suggested, SAS, and I might say REXX / ISPF |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Raj24186
New User
Joined: 04 May 2010 Posts: 9 Location: Chennai
|
|
|
|
I don't have any expertise in SAS:( . Although I am still a novice in REXX, I would appreciate if you could guide me in resolving this problem. Any other alternatives would be very beneficial!! |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Is SAS installed? Then i have a piece of coding to do the job. For the logic
you have to consult the SAS manuals. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Raj24186 wrote: |
I don't have any expertise in SAS:( . Although I am still a novice in REXX, I would appreciate if you could guide me in resolving this problem. Any other alternatives would be very beneficial!! |
Have you tried with REXX solution pointed? |
|
Back to top |
|
|
Raj24186
New User
Joined: 04 May 2010 Posts: 9 Location: Chennai
|
|
|
|
@ Peter, Yes I do have SAS installed. I can give your code a try.
@ Escapa - I have not tried it with Rexx yet! |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Hope this will help :
Code: |
//XIBFSRUN JOB 01,MSGCLASS=G,CLASS=D,NOTIFY=XIBF,REGION=0M 00010000
//XIBFSAS EXEC SAS,WORK='5000,5000' 00060000
//STEPLIB DD 00070000
// DD 00080000
// DD DSN=XIBF.SAS.LOAD,DISP=SHR 00090000
//WORK DD SPACE=(CYL,(50,50)),DCB=(LRECL=32256,BLKSIZE=32256) 00100000
//SASLIB DD UNIT=SYSDA,SPACE=(CYL,(2,2)) 00110000
//FT16F001 DD SYSOUT=*,DCB=RECFM=FB
//ROOKSCAN DD * 00160000
* input files to process <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
XIBF.EPA.MACHINE.ALL.A1 00170007
XIBF.EPA.MACHINE.ALL.A2 00180007
XIBF.EPA.MACHINE.ALL.A4 00190007
XIBF.EPA.MACHINE.ALL.FA 00200007
XIBF.EPA.MACHINE.ALL.FC 00210007
XIBF.EPA.MACHINE.ALL.FD 00220007
XIBF.EPA.MACHINE.ALL.FE 00230007
XIBF.EPA.MACHINE.ALL.T3 00240007
//SYSIN DD * 00250000
**********************************************************************; 00260000
OPTIONS NOCENTER LS=85 PS=64 MEMSIZE=300M NOMPRINT NOSOURCE2; 00300000
**********************************************************************; 00310000
DATA _NULL_ 00320000
; 00330000
LENGTH DSN $44; 00350000
INFILE ROOKSCAN; 00360000
INPUT DSN $; 00370000
IF SUBSTR(DSN,1,1) = '*' THEN RETURN; 00380000
INFILE DUMMY FILEVAR=DSN END=END; 00390000
DO UNTIL(END); 00400000
INPUT @1 INREC $CHAR80./* assuming input files are lrecl=80*/ 00410000
FILE FT16F001;
IF INDEX(INREC,'search argument') > 0 THEN /*<<<<<<<<<<<<<<<<<*/
PUT @1 DSN @46 'search argument'; /*<<<<<<<<<<<<<<<<<*/
END; 00470000
RUN; 00480000
*; 00490000
|
|
|
Back to top |
|
|
Raj24186
New User
Joined: 04 May 2010 Posts: 9 Location: Chennai
|
|
|
|
Thanks Peter. I will give it a try and let you know! |
|
Back to top |
|
|
|