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

Cond code using previous step record count in sort


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Tue Apr 29, 2014 5:36 pm
Reply with quote

Hi ALL,

we have a requirement like..
Step1 have one sortin file .The file have value 'A' in 9th position.for this sinaerio i have to skip the step2 or do to condtion code.
If any other value we need to allow the next step..

Can you please help to create a JCL for the above condtions.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 29, 2014 6:04 pm
Reply with quote

here is a snippet that will retuun a 4/0 rc

Code:
 ****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  3 Line(s) not Displayed
 000004 //RC4     EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 12345678901234567890
 000009 //SORTOUT   DD DUMMY
 000010 //SYSIN     DD *
 000011   OPTION COPY
 000012   OUTFIL NULLOFL=RC4,INCLUDE=(9,1,CH,EQ,C'A')
 000013 //*
 000014 //RC4     EXEC PGM=SORT
 000015 //SYSPRINT  DD SYSOUT=*
 000016 //SYSOUT    DD SYSOUT=*
 000017 //SORTIN    DD *
 000018 12345678A01234567890
 000019 //SORTOUT   DD DUMMY
 000020 //SYSIN     DD *
 000021   OPTION COPY
 000022   OUTFIL NULLOFL=RC4,INCLUDE=(9,1,CH,EQ,C'A')
 000023 //*
 ****** **************************** Bottom of Data ****************************


result
Code:
14.32.08 JOB00813  IEF403I ENRICO1 - STARTED - TIME=14.32.08
14.32.08 JOB00813  HTRT01I                                         CPU (Total)
14.32.08 JOB00813  HTRT02I Jobname  Stepname ProcStep    RC    I/O hh:mm:ss.th
14.32.08 JOB00813  HTRT03I ENRICO1  RC4                  04     39       00.05
14.32.08 JOB00813  HTRT03I ENRICO1  RC4                  00     38       00.05
14.32.08 JOB00813  IEF404I ENRICO1 - ENDED - TIME=14.32.08
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 29, 2014 6:05 pm
Reply with quote

Not really clear what you are after, but see if NOTMTOUT/NULLOUT, NOTMTOFL/NULLOFL can give you what you want. If you write all your As to SORTOUT/an OUTFIL you can set an RC (limited range of values).

What is available to you depends on your version of SyncSort. If you 1.4 onwards, I think you will have NOTMTOUT and NOTMTOFL, and it will be easy. You can dummy out the output in the JCL, since you won't need it, you just want the return-code.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 29, 2014 6:10 pm
Reply with quote

icon_redface.gif
posted a DFSORT snippet ...

I had not noticed the post being in the JCL section for SYNCSORT
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Tue Apr 29, 2014 6:41 pm
Reply with quote

enrico-sorichetti wrote:
here is a snippet that will retuun a 4/0 rc

Code:
 ****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  3 Line(s) not Displayed
 000004 //RC4     EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 12345678901234567890
 000009 //SORTOUT   DD DUMMY
 000010 //SYSIN     DD *
 000011   OPTION COPY
 000012   OUTFIL NULLOFL=RC4,INCLUDE=(9,1,CH,EQ,C'A')
 000013 //*
 000014 //RC4     EXEC PGM=SORT
 000015 //SYSPRINT  DD SYSOUT=*
 000016 //SYSOUT    DD SYSOUT=*
 000017 //SORTIN    DD *
 000018 12345678A01234567890
 000019 //SORTOUT   DD DUMMY
 000020 //SYSIN     DD *
 000021   OPTION COPY
 000022   OUTFIL NULLOFL=RC4,INCLUDE=(9,1,CH,EQ,C'A')
 000023 //*
 ****** **************************** Bottom of Data ****************************


result
Code:
14.32.08 JOB00813  IEF403I ENRICO1 - STARTED - TIME=14.32.08
14.32.08 JOB00813  HTRT01I                                         CPU (Total)
14.32.08 JOB00813  HTRT02I Jobname  Stepname ProcStep    RC    I/O hh:mm:ss.th
14.32.08 JOB00813  HTRT03I ENRICO1  RC4                  04     39       00.05
14.32.08 JOB00813  HTRT03I ENRICO1  RC4                  00     38       00.05
14.32.08 JOB00813  IEF404I ENRICO1 - ENDED - TIME=14.32.08


Hi Enrico,

Thank you very much for you useful JCL!!!

Quote de-mangled
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 29, 2014 6:44 pm
Reply with quote

No problem enrico. It is the same solution for earlier versions of SyncSort.

The "NOTMT" (must stand for something, can't think what...) extend the ability to set the RC so that it can be done when data is written to SORTOUT or an OUTFIL dataset, which simplifies some negative and contrived situations.
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Tue Apr 29, 2014 8:18 pm
Reply with quote

Hi Enrico,

Acutally i have 100 records in input file.But i want to check only the first record.How can we do this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Apr 29, 2014 8:31 pm
Reply with quote

Code:
    OPTION COPY,STOPAFT=1
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Apr 30, 2014 12:20 pm
Reply with quote

Bill Woodger wrote:
The "NOTMT" (must stand for something, can't think what...)
Hi Bill,

Since this for issuing an RC when the correponding output dd is NOT empty, NOTMT could indicate NOTempty icon_smile.gif
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top