Sorting JCL



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sorting JCL

Postby jfullmetal » Wed Jul 20, 2011 7:28 pm

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
jfullmetal
 
Posts: 5
Joined: Fri Jan 21, 2011 3:00 am
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting JCL

Postby BillyBoyo » Wed Jul 20, 2011 8:21 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Sorting JCL

Postby Frank Yaeger » Wed Jul 20, 2011 11:08 pm

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
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post