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
 

 

Need to search a string in the input file

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

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Wed Feb 11, 2009 8:27 pm    Post subject: Need to search a string in the input file
Reply with quote

I have an Input strings which is having a data of varible block, say record length of 503

Input file
Ex:
Praveen is good
PSN is fine

I need to search the string Praveen in the input file.

I have used ICETOOL utility.Please find the JCL below.
Code:

//STEP030   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*                                     
//DFSMSG    DD  SYSOUT=*                                     
//IN1       DD DSN=SSSDEV3.SRCUSER.BTOR.MASTER,DISP=SHR     
//OUT1      DD DSN=SSSDEV3.SRCUSER.BTOR.SRCHOP,             
//             DISP=(MOD,CATLG,DELETE),UNIT=SYSDA,                   
//             SPACE=(CYL,(200,100),RLSE)                   
//TOOLIN    DD *
COPY FROM(IN1) TO(OUT1) USING(CT01)
/*   
//CT01CNTL  DD *
  OUTFIL FNAMES=OUT1,REMOVECC,     
    HEADER1=('0000 NEPTUNE')         
  INCLUDE COND=(5,503,SS,EQ,C'Praveen')
  SORT FIELDS=COPY,STOPAFT=25010   
  INREC FIELDS=(5,503)
/*



Where,
SSSDEV3.SRCUSER.BTOR.MASTER is of record length: 503 variable block,

The above JCL is working fine for Fixed block, but for the Variable block I'm getting an error saying:
Code:

ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5           
ICE162I 0 ICEIEXIT CHANGED ONE OR MORE OPTIONS IN EFFECT         
ICE126A 0 INCONSISTENT *INREC   IFTHEN 0 REFORMATTING FIELD FOUND


Praveen.N
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Feb 11, 2009 8:35 pm    Post subject:
Reply with quote

Well, if you want the output to be VB, don't you need to inrec the lbb in 1-4?
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: Wed Feb 11, 2009 11:05 pm    Post subject:
Reply with quote

If your records are VB, then they have a 4-byte RDW followed by the data. If the data is 503 bytes long, then the record is 507 bytes long.
For a VB record, INREC must include the RDW in the first field. So:

Code:

  INREC FIELDS=(5,503)


is invalid since it doesn't include the RDW. Assuming you have 503 data bytes, it should be:

Code:

   INREC FIELDS=(1,4,5,503)


Note: The order of processing for your statements is INCLUDE, INREC, SORT, OUTFIL. I find it helps to code the statements in their processing order as a visual aid.
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Thu Feb 12, 2009 9:58 am    Post subject:
Reply with quote

Hi all,


Thanks for this,

As suggested by you i am trying with this, but i am getting the below error.

Sort card:

OUTFIL FNAMES=OUT1,REMOVECC,
HEADER1=('0000 Praveen')
INCLUDE COND=(1,4,5,503,SS,EQ,C
'Praveen')
SORT FIELDS=COPY,STOPAFT=25010
INREC FIELDS=(1,4,5,503)



Error:

INCLUDE COND=(1,4,5,503,SS,EQ,C
$
ICE007A 0 SYNTAX ERROR
'NEPTUNE')
$
ICE007A 1 SYNTAX ERROR
SORT FIELDS=COPY,STOPAFT=25010
INREC FIELDS=(1,4,5,503)
ICE146I 0 END OF STATEMENTS FROM CT01CNTL - PARAMETER LIST STATEMENTS FOLLOW
DEBUG NOABEND,ESTAE
OPTION MSGDDN=DFSMSG,LIST,MSGPRT=ALL,RESINV=0,SORTDD=CT01,SORTIN=IN1,S
RTOUT=OUT1,DYNALLOC
SORT FIELDS=COPY



Thanks,
Praveen.N
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Thu Feb 12, 2009 10:01 am    Post subject:
Reply with quote

Hi,

Please note:

In the above sort card the error is at '5' in the Include condition(INCLUDE COND).

Could you please provide me the JCL for this query.

Thanks,
Praveen.N
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: Thu Feb 12, 2009 9:37 pm    Post subject:
Reply with quote

Quote:
As suggested by you i am trying with this


That's NOT what I suggested. I suggested adding 1,4 to the INREC statement, not to the INCLUDE COND.

Why did you add '1,4' in the INCLUDE COND? That causes the syntax to be invalid.

Remove "1,4" from the INCLUDE COND.

And if you really have C on one line and the constant on the next line, you need to have them all on one line, e.g. C'Praveen'.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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