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
 

 

Search a string only in first record of a PS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Search a string only in first record of a PS file
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    Post subject:
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    Post subject: Reply to: ISRSUPC
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    Post subject:
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    Post subject: Re: ISRSUPC
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

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Oct 21, 2008 6:19 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Using ICETOOL
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: 2360
Location: Israel

PostPosted: Wed Oct 22, 2008 12:49 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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