I am new to this forum. I have a requirement to extract 4 consecutive alphabets in a record from position 11 to 25 thru JCL. If four consecutive alphabets present in a records that will be written to Outfile1 and rest of the records should be in Outfile2. Please give me idea to proceed.
My input file length is 80 bytes and it is FB format. Below is the sample for my requirement.
1234234345RAJAN3007801987TRICHYREC..... - RAJAN has 4 consecutive Alphabet from 11-25 column
1234234345R3007DIYA801987TRICHYREC..... - DIYA has 4 consecutive Alphabet from 11-25 column
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
Quote:
I have a requirement to extract 4 consecutive alphabets in a record from position 11 to 25 thru JCL.
This cannot be done. Repeat after me ... JCL EXECUTES PROGRAMS. It does not extract data, it does not transform data, it does nothing but execute programs.
You could accomplish this via SORT (I believe), or COBOL, or Assembler, or PL/I ... if you could use a program in your JCL.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
M.RAJAN,
Assuming that by "alphabets", you mean anything other than '0'-'9', you can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. Note that this is easily extendable to checking for more or less than 4 consecutive characters by changing the constant in the OUTFIL INCLUDE operand (e.g. C'111' for 3 characters).