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 to find 4 consecutive alphabets in a record in JCL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
M.RAJAN

New User


Joined: 18 Jul 2005
Posts: 5
Location: chennai

PostPosted: Tue Jun 23, 2009 5:43 am    Post subject: How to find 4 consecutive alphabets in a record in JCL ?
Reply with quote

Hi All,

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.

Input file.

1234234345RAJAN3007801987TRICHYREC.....
2342424344RAJ234242343RRT3424324243....
1234234345R3007DIYA801987TRICHYREC.....
8759872522LJ3453LK345434LL34KJGJDLDS....

Outfile1.

1234234345RAJAN3007801987TRICHYREC..... - RAJAN has 4 consecutive Alphabet from 11-25 column
1234234345R3007DIYA801987TRICHYREC..... - DIYA has 4 consecutive Alphabet from 11-25 column

Outfile2.
2342424344RAJ234242343RRT3424324243....
8759872522LJ3453LK345434LL34KJGJDLDS....
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7932
Location: Bellevue, IA

PostPosted: Tue Jun 23, 2009 7:11 am    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Jun 23, 2009 8:36 am    Post subject:
Reply with quote

Hi,

here is a possible solution
Code:
//S1       EXEC PGM=ICEMAN                         
//SYSOUT   DD SYSOUT=*                             
//SYMNAMES DD *                                   
CHECK,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'                 
/*                                                 
//SORTIN   DD *                                   
1234234345RAJAN3007801987TRICHYREC.....           
2342424344RAJ234242343RRT3424324243....           
1234234345R3007DIYA801987TRICHYREC.....           
8759872522LJ3453LK345434LL34KJGJDLDS               
/*                                                 
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                         
  OPTION COPY                           
  INCLUDE FORMAT=SS,                   
    COND=(11,1,EQ,CHECK,&,             
          12,1,EQ,CHECK,&,             
          13,1,EQ,CHECK,&,             
          14,1,EQ,CHECK,OR,             
*                                       
          12,1,EQ,CHECK,&,             
          13,1,EQ,CHECK,&,             
          14,1,EQ,CHECK,&,             
          15,1,EQ,CHECK,OR,             
*                                       
          13,1,EQ,CHECK,&,             
          14,1,EQ,CHECK,&,             
          15,1,EQ,CHECK,&,             
          16,1,EQ,CHECK,OR,             
*                                       
          14,1,EQ,CHECK,&,             
          15,1,EQ,CHECK,&,             
          16,1,EQ,CHECK,&,           
          17,1,EQ,CHECK,OR,           
*                                     
          15,1,EQ,CHECK,&,           
          16,1,EQ,CHECK,&,           
          17,1,EQ,CHECK,&,           
          18,1,EQ,CHECK,OR,           
*                                     
          16,1,EQ,CHECK,&,           
          17,1,EQ,CHECK,&,           
          18,1,EQ,CHECK,&,           
          19,1,EQ,CHECK,OR,           
*                                     
          17,1,EQ,CHECK,&,           
          18,1,EQ,CHECK,&,           
          19,1,EQ,CHECK,&,           
          20,1,EQ,CHECK,OR,           
*                                     
          18,1,EQ,CHECK,&,           
          19,1,EQ,CHECK,&,           
          20,1,EQ,CHECK,&,           
          21,1,EQ,CHECK,OR,                   
*                                             
          19,1,EQ,CHECK,&,                     
          20,1,EQ,CHECK,&,                     
          21,1,EQ,CHECK,&,                     
          22,1,EQ,CHECK,OR,                   
*                                             
          20,1,EQ,CHECK,&,                     
          21,1,EQ,CHECK,&,                     
          22,1,EQ,CHECK,&,                     
          23,1,EQ,CHECK,OR,                   
*                                             
          21,1,EQ,CHECK,&,                     
          22,1,EQ,CHECK,&,                     
          23,1,EQ,CHECK,&,                     
          24,1,EQ,CHECK,OR,                   
*                                             
          22,1,EQ,CHECK,&,                     
          23,1,EQ,CHECK,&,                     
          24,1,EQ,CHECK,&,                     
          25,1,EQ,CHECK)                       
/*



Gerry
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: Tue Jun 23, 2009 8:55 pm    Post subject:
Reply with quote

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).

Code:

//S1       EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file (FB/80)
//SORTOUT  DD DSN=...  output file (FB/80)
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:15C'1')),
    IFTHEN=(WHEN=(11,1,FS,EQ,NUM),OVERLAY=(81:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(12,1,FS,EQ,NUM),OVERLAY=(82:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(13,1,FS,EQ,NUM),OVERLAY=(83:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(14,1,FS,EQ,NUM),OVERLAY=(84:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(15,1,FS,EQ,NUM),OVERLAY=(85:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(16,1,FS,EQ,NUM),OVERLAY=(86:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(17,1,FS,EQ,NUM),OVERLAY=(87:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(18,1,FS,EQ,NUM),OVERLAY=(88:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(19,1,FS,EQ,NUM),OVERLAY=(89:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(20,1,FS,EQ,NUM),OVERLAY=(90:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(21,1,FS,EQ,NUM),OVERLAY=(91:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(22,1,FS,EQ,NUM),OVERLAY=(92:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(23,1,FS,EQ,NUM),OVERLAY=(93:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(24,1,FS,EQ,NUM),OVERLAY=(94:C'0'),HIT=NEXT),
    IFTHEN=(WHEN=(25,1,FS,EQ,NUM),OVERLAY=(95:C'0'))
  OUTFIL INCLUDE=(81,15,SS,EQ,C'1111'),BUILD=(1,80)
/*
Back to top
View user's profile Send private message
M.RAJAN

New User


Joined: 18 Jul 2005
Posts: 5
Location: chennai

PostPosted: Wed Jun 24, 2009 12:13 am    Post subject: Reply to: How to find 4 consecutive alphabets in a record in
Reply with quote

Hi Frank & Gerry,

I tried these 2 ways. Both are working as expected. Thanks a lot.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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