Page 1 of 1

Sorting JCL

PostPosted: Wed Jul 20, 2011 7:28 pm
by jfullmetal
Hi All,

I need your help in creating a JCL for Sorting. I am completely new to Mainframes. I have a dataset which contains information in below format.

*************************************************************************************
000103 LID(XXXXXXX)
000104 THE FOLLOWING PARAMETERS ARE IN EFFECT:
000105 DATE=06/27/11 TIME=0312 SOURCE=******** UID=IN**************XXXXXXX
000106 LID=XXXXXXX ROLE=
000107
000108 TARGET RESOURCE: ABC A27*
000109
000110 VALIDATED RULE LINE FROM A27* TYPE ABC
000111 UID(IN**************XXXXXXX) ALLOW
000112
000113 RESULT: ACCESS WOULD BE ALLOWED
000114 REASON: RESOURCE RULE
000122 LID(XXXXXXXX)
000123 THE FOLLOWING PARAMETERS ARE IN EFFECT:
000124 DATE=06/27/11 TIME=0312 SOURCE=******** UID=IN**************XXXXXXX
000125 LID=XXXXXXX ROLE=
000126
000127 TARGET RESOURCE: ABC A37*
000128
000129 NO RULE APPLIES IN RESOURCE RECORD A37* TYPE ABC
000131 RESULT: ACCESS WOULD BE DENIED
000132

*********************************************************************************************

I would like to move all the " RESULT: ACCESS WOULD BE DENIED " to another dataset. I am not sure if that is possible.
I researched a bit and found out that sorting can be done but not sure where to begin.

Any suggestion would be appreciated

JFullmetal

Re: Sorting JCL

PostPosted: Wed Jul 20, 2011 8:21 pm
by BillyBoyo
Something as simple as

 INCLUDE COND=(1,youdothecounting,EQ,"RESULT: ACCESS WOULD BE DENIED")


would get you records which include that text in that particular place.

Re: Sorting JCL

PostPosted: Wed Jul 20, 2011 11:08 pm
by Frank Yaeger
JFullMetal,

Assuming the constant can be anywhere in your records, you can use a DFSORT job like the following to do what you asked for. Make sure the constant in the INCLUDE statement is identical to the constant in your records (e.g. matching number of spaces).

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(1,80,SS,EQ,C' RESULT: ACCESS WOULD BE DENIED ')
/*


If the constant is always at a specific starting position in your records, you can use:

  INCLUDE COND=(p,31,CH,EQ,C' RESULT: ACCESS WOULD BE DENIED ')


where p is the starting position.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080