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: 995
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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