IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Search a string only in first record of a PS file


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Oct 21, 2008 5:52 pm
Reply with quote

I want to search a string only in first record of a PS file. What should I code in sysin along with
//SYSIN DD *
SRCHFOR 'STRNG'
/*

I'm using utility ISRSUPC.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Oct 21, 2008 5:56 pm
Reply with quote

what about sort instead of isrsupc

Code:
//STEP0100 EXEC PGM=ICEMAN       
//SYSOUT    DD SYSOUT=*         
//SORTIN    DD *                 
1 HI                       
2 HI                       
3 HI                         
/*                               
//SORTOUT   DD SYSOUT=*         
//SYSIN     DD *                 
  OPTION COPY                   
  INCLUDE COND=(1,80,SS,EQ,C'HI')
  OUTFIL ENDREC=0000001         
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 21, 2008 6:07 pm
Reply with quote

Hi,

I thought ParagChouguley is asking for the below:

Code:

//STEP0100 EXEC PGM=ICEMAN       
//SYSOUT    DD SYSOUT=*         
//SORTIN    DD *                 
1 HI                             
2 HI                             
3 HI                             
/*                               
//SORTOUT   DD SYSOUT=*         
//SYSIN     DD *                 
  OPTION COPY,STOPAFT=1         
  INCLUDE COND=(1,80,SS,EQ,C'HI')


Thanks.
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Oct 21, 2008 6:12 pm
Reply with quote

Thanks both of you for your quick replies !
But can I not achieve it using ISRSUPC ?
Thnaks in advance !
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Oct 21, 2008 6:13 pm
Reply with quote

ParagChouguley wrote:
I want to search a string only in first record of a PS file.


the output of
Code:

//*----------------------------------------------------
//STEP0100 EXEC PGM=ICEMAN                             
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD *                                       
1                                                 
2 HI                                             
3 HI                                               
/*                                                     
//SORTOUT   DD SYSOUT=*                               
//SYSIN     DD *                                       
  OPTION COPY,STOPAFT=1                               
  INCLUDE COND=(1,80,SS,EQ,C'HI')                     


will be
Code:
2 HI                 


wich is not the FIRST RECORD of the file.


if by 'FIRST RECORD' he/she means 'FIRST OCURRENCE' then STOPAFT is right, and so FMSTOP in ISRSUPC.

hth
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Oct 21, 2008 6:19 pm
Reply with quote

OP wants to use ISRSUPC. To achieve the object, first copy just the desired record to a workdataset using a suitable utility (IEBGENER, IDCAMS....). Then execute ISRSUPC against this workdataset to search for the desired string.

Garry.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Oct 21, 2008 6:23 pm
Reply with quote

ParagChouguley wrote:

But can I not achieve it using ISRSUPC ?


if the question is using only isrsupc, AFAIK, no.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Oct 21, 2008 6:39 pm
Reply with quote

Sorry, I gave a wrong solution in my earlier post........ icon_redface.gif

Here is the correct one using ICETOOL:

Code:

//STEP0300 EXEC PGM=ICETOOL                                         
//TOOLMSG   DD SYSOUT=*                                             
//SSMSG     DD SYSOUT=*                                             
//IN1       DD *                                                     
1 HI                                                                 
2 HI                                                                 
3 HI                                                                 
/*                                                                   
//OUT1      DD DSN=&&T1,DISP=(MOD,PASS,DELETE),SPACE=(TRK,(1,1),RLSE)
//OUT2      DD SYSOUT=*                                             
//TOOLIN    DD *                                                     
 COPY FROM(IN1) TO(OUT1) USING(RAM1)                                 
 COPY FROM(OUT1) TO(OUT2) USING(RAM2)                               
/*                                                                   
//RAM1CNTL  DD *                                                     
 SORT FIELDS=COPY,STOPAFT=1                                         
/*                                                                   
//RAM2CNTL  DD *                                                     
 INCLUDE COND=(1,80,SS,EQ,C'HI')                                     
/*


HTH
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Oct 22, 2008 12:49 am
Reply with quote

Try the CMPLINE statement of SUPERC.

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top