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
 

 

step to end with return code of 1 if a condition is met

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

New User


Joined: 18 May 2007
Posts: 27
Location: Hyderabad

PostPosted: Thu Jun 27, 2013 9:32 pm    Post subject: step to end with return code of 1 if a condition is met
Reply with quote

I want to end the step with return code of 1 , if the following condition is met

Input file:

06/27/2013
USERNAME X
USERNAME X

Input file Record format is FB and record lenght is 12.

First record in the file is header and it only contains date in the format MM/DD/YYYY

Staring from the second record are the detail lines

Month in the header date should be current month and first 8 bytes in the detail lines should be 'USERNAME' in every record ,
If these conditions are met , then the step should end with retrun code of 1.
I dont want any data to be written in the output file.
What date function can be used in DFSORT for this requirement.

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

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Jun 27, 2013 9:45 pm    Post subject:
Reply with quote

This requirement cannot be fulfilled.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Thu Jun 27, 2013 11:04 pm    Post subject:
Reply with quote

Is this must do requirement in DFSORT?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Thu Jun 27, 2013 11:57 pm    Post subject:
Reply with quote

I'm impressed that someone who has been on this forum for 6 years has not:

1. paid attention to the numerous other posts that have CLEARLY stated that DFSORT only sets certain return codes, and 1 is not one of them

2. figured out how to read the DFSORT / ICETOOL manuals (for which there is a link at the top of this page) and found the specific return codes that can be set by DFSORT / ICETOOL.

madishpa. you actually have several choices:
- give up on the idea of having a return code of 1 for your sort and accept the return code DFSORT / ICETOOL generates
- give up on the idea of using DFSORT / ICETOOL and use a language that will allow you to set a return code of 1
- accept that getting a return code of 1 is not possible with DFSORT / ICETOOL and hence what you have asked is not at all possible, period.
Back to top
View user's profile Send private message
madishpa

New User


Joined: 18 May 2007
Posts: 27
Location: Hyderabad

PostPosted: Fri Jun 28, 2013 12:09 am    Post subject: Reply to: step to end with return code of 1 if a condition i
Reply with quote

Return code of 4 is also fine , I just want to end with a different return code other than 0 ,so that I can control the execution of next steps
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jun 28, 2013 5:04 am    Post subject:
Reply with quote

Hi,

give this a try
Code:

//STEP0001 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
06/27/2013                                                 
USERNAME X                                                 
USERNAME X                                                 
//SORTOUT  DD DUMMY                                       
//SYSIN    DD *                                                                                 
    OPTION COPY,STOPAFT=1                                 
    INREC OVERLAY=(13:DATE1)                               
    OUTFIL NULLOFL=RC4,INCLUDE=(1,2,CH,NE,17,02,CH)       
/*                                                         
//STEP0002 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
06/27/2013                                                 
USERNAME X                                                 
USERNAME X                                                 
//SORTOUT  DD DUMMY                                       
//SYSIN    DD *                                                                               
    OPTION COPY,SKIPREC=1                                 
    OUTFIL NULLOFL=RC4,INCLUDE=(1,8,CH,NE,C'USERNAME')     
/*                                                         



Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Jun 28, 2013 12:00 pm    Post subject: Reply to: step to end with return code of 1 if a condition i
Reply with quote

Yes. If desired, can be done in one step by adding a sequence number and using that for OUTFIL INCLUDE/OMIT to keep the two separate tests distinct.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Jun 28, 2013 12:41 pm    Post subject:
Reply with quote

Hi Bill,

if one test returns a 4 and one returns a 0, which return code do you test for ?


Gerry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Jun 28, 2013 2:08 pm    Post subject: Reply to: step to end with return code of 1 if a condition i
Reply with quote

Sorry Gerry.

When I saw INCLUDE with NE I thought "that's OMIT" and didn't look any further :-)

OMIT all the good data, gives 4 if file is OK, 0 if not.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 28, 2013 10:34 pm    Post subject:
Reply with quote

gcicchet wrote:
Hi Bill,

if one test returns a 4 and one returns a 0, which return code do you test for ?


Gerry


Gerry,

As Bill mentioned you can use sequence number validate the records and set the return code in a single step.

1. Add a seqnum and a constant "P"
2. Using IFTHEN validate the seqnum=1 and see if the file date has current month and if not OVERLAY the constant to a space.
3. Similary validate the seqnum>2 and see if the first 8 bytes is username and if not replace the constant with space.

Now Use OUTFIL OMIT the values with "P" and set the return code to 4. So if all records matched the conditions you will have an empty file, if not you will have the space records.

You also don't need to use DATE1 to validate the current month, you just need a dynamic system symbol with &LMON and you can use that to filter out the records.
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 What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


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