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
 

 

Is it possible in to find a word & set RC co

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

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Fri Jul 23, 2010 1:47 pm    Post subject: Is it possible in to find a word & set RC co
Reply with quote

I need to find a word in Dataset and then to set Return code for that step.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Jul 23, 2010 2:16 pm    Post subject:
Reply with quote

Can you explain more about your requirement. Do you have only a single record in your input file? If there are multiple records, how do you want to search for the 'word'? Input LRECL,RECFM?
Back to top
View user's profile Send private message
venkat.bmw
Warnings : 2

New User


Joined: 05 May 2009
Posts: 21
Location: India

PostPosted: Fri Jul 23, 2010 2:55 pm    Post subject:
Reply with quote

Only two letters eg: 'IT' . If it is present in dataset then I have to change the RC.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Jul 23, 2010 3:57 pm    Post subject:
Reply with quote

Quote:
I have to change the RC
You can't change an RC once issued. And you have nt given enough information for somebody to help you.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 4:21 pm    Post subject:
Reply with quote

You can use reverse logic and set a return code if the selected literal is not found, and then execute the following steps conditionally upon the result.

The code below will give RC=4 if the literal 333 is not found in the file and will give RC=0 if it is found.
Code:
//DFSORT   EXEC PGM=SORT,PARM='NULLOUT=RC4' 
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                             
XXXYYYZZZ                                   
XXXYYYZZZ                                   
XXXYYY222                                   
XXXYYYZZZ                                   
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                             
 OPTION COPY                                 
 INCLUDE COND=(1,20,SS,EQ,C'333') 
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Jul 23, 2010 4:33 pm    Post subject:
Reply with quote

expat,

I see a possibility where there are multiple records and the word has to be checked in all the records? May be not. Who knows. icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 4:35 pm    Post subject:
Reply with quote

I was working on the principle that the OP knows what he wants icon_eek.gif and has said that he wants to find the word in the dataset rather than specific records.
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: Fri Jul 23, 2010 9:41 pm    Post subject:
Reply with quote

Eagar,

Here's a DFSORT job that will give you a RC=4 if 'IT' is found or a RC=0 if 'IT' is not found. You could use NULLOUT=RC16 to get RC=16 instead of RC=4 if that's what you want. I assumed your input file has RECFM=FB and LRECL=80.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DUMMY
//SYSIN DD *
  OPTION COPY,NULLOUT=RC4
  OMIT COND=(1,80,SS,EQ,C'IT')
/*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 11:29 pm    Post subject:
Reply with quote

Brilliant Frank. I should have thought of that as well icon_redface.gif

I didn't think to use OMIT instead of INCLUDE
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Jul 23, 2010 11:43 pm    Post subject:
Reply with quote

The question of the possibility of multiple records in the 'dataset' (one or more containing the 'word' and one or more not containing the 'word') has been asked several times but not answered......
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Sat Jul 24, 2010 12:54 am    Post subject:
Reply with quote

CICS Guy,

It was asked twice by the same person.

It was not part of the original requirement, no reason to think it should be a factor, obviously not an issue.

Good solutions to the requirement have been posted.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat Jul 24, 2010 1:07 am    Post subject:
Reply with quote

I am not so sure Dave, with multiple records, I can see some being omitted while others are outputed, i.e., the 'word' in some and still a zero RC.....
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: Sat Jul 24, 2010 1:10 am    Post subject:
Reply with quote

Apparently, the OP has lost interest.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Sat Jul 24, 2010 1:12 am    Post subject:
Reply with quote

The requirement said nothing about an output file.

Quote:

I need to find a word in Dataset and then to set Return code for that step.


Quote:

Only two letters eg: 'IT' . If it is present in dataset then I have to change the RC.


No reference to on a line, or writing the line to a file.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jul 24, 2010 1:13 am    Post subject: Reply to: Is it possible in to find a word & set RC co
Reply with quote

After 11pm on Friday, i might lose interest too. . . icon_smile.gif

Have a great weekend!

d
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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts how to find clist's or view library Andrew Hsia CLIST & REXX 4 Tue Jun 28, 2016 6:07 pm
No new posts How to find jobs that are in schedule... anilkumar922 All Other Mainframe Topics 5 Tue Jun 28, 2016 10:01 am


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