Re: DFSORT with empty outputs

2017-06-01 Thread Sri h Kolusu
>>All of this with ONE single pass to read the input datasets (which are 
very very large sometimes). 

Elardus,

I just moved your existing SORT operator as a separate step to check for 
empty input.   It is the same job you had.

Thanks,
Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on 
06/01/2017 12:48:44 AM:

> From: Elardus Engelbrecht <elardus.engelbre...@sita.co.za>
> To: IBM-MAIN@LISTSERV.UA.EDU
> Date: 06/01/2017 12:49 AM
> Subject: Re: DFSORT with empty outputs
> Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>
> 
> Sri h Kolusu wrote:
> 
> >Here is a JCL which will give you the desired results. I rearrange 
> your INCLUDE conditions in the order of positions and it is easy to 
> read and Understand. 
> 
> Many thanks for your kind help.
> 
> After looking at your job, I see that the output datasets are primed
> first with 'nothing' and only conditionally overwritten if records 
> were selected/found.
> 
> All of this with ONE single pass to read the input datasets (which 
> are very very large sometimes). 
> 
> Hmmm, I see NULLOUT=RC4. Time for me to do serious RTFM on that one. ;-)
> 
> I will not use step STEP0100, because all my output datasets are 
> temporary which only lives during the job. The contents are e-mailed
> out and also stored somewhere.
> 
> Again, Sri, many many thanks for kindly helping me to SORT out this 
issue.
> 
> Much appreciated.
> 
> I will come back to IBM-MAIN and show how I did it.
> 
> Groete / Greetings
> Elardus Engelbrecht
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> 



--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: DFSORT with empty outputs

2017-06-01 Thread Elardus Engelbrecht
Sri h Kolusu wrote:

>Here is a JCL which will give you the desired results. I rearrange your 
>INCLUDE conditions in the order of positions and it is easy to read and 
>Understand. 

Many thanks for your kind help.

After looking at your job, I see that the output datasets are primed first with 
'nothing' and only conditionally overwritten if records were selected/found.

All of this with ONE single pass to read the input datasets (which are very 
very large sometimes). 

Hmmm, I see NULLOUT=RC4. Time for me to do serious RTFM on that one. ;-)

I will not use step STEP0100, because all my output datasets are temporary 
which only lives during the job. The contents are e-mailed out and also stored 
somewhere.

Again, Sri, many many thanks for kindly helping me to SORT out this issue.

Much appreciated.

I will come back to IBM-MAIN and show how I did it.

Groete / Greetings
Elardus Engelbrecht

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: DFSORT with empty outputs

2017-05-31 Thread Sri h Kolusu
Elardus,

Here is a JCL which will give you the desired results. I rearrange your 
INCLUDE conditions in the order of positions and it is easy to read and 
Understand. 

We set up a return code of 4 if the INCLUDE results in an empty input. We 
then validate that return code and write the reports or leave them as is. 
If the step0200 results in a empty dataset then you will have return code 
of 4 and the step0300 will NOT run.

//***
//* DELETE IF THE REPORT DATASETS EXIST**
//***
//STEP0100 EXEC PGM=IEFBR14 
//DD01 DD DSN=, 
//DISP=(MOD,DELETE,DELETE), 
//SPACE=(TRK,(1,0),RLSE) 
//* 
//DD02 DD DSN=, 
//DISP=(MOD,DELETE,DELETE), 
//SPACE=(TRK,(1,0),RLSE) 
//* 
//***
//* SET RETURN CODE OF 4 IF THE INCLUDE CONDITIONS RESULT  **
//* IN A EMPTY OUTPUT AND HAVE THE EMPTY HEADERS   **
//***
//STEP0200 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD DISP=SHR,DSN=Your Input VB file 
//SORTOUT  DD DSN=&,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE) 
//PRINT3R  DD DSN=, 
//DISP=(NEW,CATLG,DELETE), 
//SPACE=(CYL,(25,25),RLSE) 
/* 
//PRINT3T  DD DSN=, 
//DISP=(NEW,CATLG,DELETE), 
//SPACE=(CYL,(25,25),RLSE) 
/* 
//SYSINDD * 
  OPTION VLSCMP,NULLOUT=RC4 
 
  INCLUDE COND=(005,04,CH,EQ,C'0200',AND, 
054,04,CH,NE,C'YES',AND, 
(100,08,CH,EQ,C'@GROEP',OR, 
 100,08,CH,EQ,C'@PREFIX'),AND, 
118,10,CH,NE,C' ',AND, 
(118,10,CH,NE,19,10,CH)) 
 
 
  SORT FIELDS=(10,8,CH,A) 
 
  OUTFIL FNAMES=PRINT3R,REMOVECC, 
  HEADER2=(001:'@PREFIX - @SYSTM: ACTIVE IDS', 
   037:DATE(4MD/), 
   055:TIME(24:), 
   068:PAGE,/,3/, 
   001:'NR  USER ID   USER NAME ', 
   'DFLT GROUP  CREATED LAST USED',/, 
   001:'--  ---     ', 
   '--  --  --',/, 
   001:' NO IDS FOUND') 
 
  OUTFIL FNAMES=PRINT3T,REMOVECC,NODETAIL, 
  HEADER2=(001:'ACTIVE IDSCOUNT',/, 
   '--   --',/, 
   001:' NO IDS FOUND') 
//* 
//***
//* IF THE ABOVE STEP ISSUES A RETURN CODE OF ZERO THEN WE **
//* HAVE DATA AND GENERATE THE REPORT USING THE REPORT DSN **
//***
//STEP0300 EXEC PGM=ICETOOL,COND=(0,NE,STEP0200) 
//TOOLMSG  DD SYSOUT=* 
//DFSMSG   DD SYSOUT=* 
//INDD DD DISP=SHR,DSN=& 
//PRINT3R  DD DISP=SHR,DSN= 
//PRINT3T  DD DISP=SHR,DSN= 
//TOOLIN   DD * 
DISPLAY FROM(INDD) LIST(PRINT3R) - 
NOCC  - 
WIDTH(500)- 
BETWEEN(2)- 
TITLE('@PREFIX - @SYSTM: ACTIVE IDS') - 
DATE(4MD/)- 
TIME(24:) - 
PAGE  - 
BLANK - 
ON(NUM,N05)   HEADER('NR')   - 
ON(10,8,CH)   HEADER('USER ID')  - 
ON(79,20,CH)  HEADER('USER NAME')- 
ON(100,8,CH)  HEADER('DFLT GROUP')   - 
ON(19,10,CH)  HEADER('CREATED')  - 
ON(118,10,CH) HEADER('LAST USED') 
OCCUR  FROM(INDD) LIST(PRINT3T) - 
   NOCC - 
   WIDTH(500)   - 
   ON(79,1,CH)  HEADER('ACTIVE IDS') - 
   ON(VALCNT,N05)   HEADER('COUNT') 
/* 

Further if you have any questions please let me know

Thanks,
Kolusu
DFSORT Development
IBM Corporation



From:   Elardus Engelbrecht <elardus.engelbre...@sita.co.za>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   05/31/2017 04:56 AM
Subject:Re: DFSORT with empty outputs
Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>



Sri h Kolusu wrote:

>>>Is there a DFSORT or ICETOOL statement where the output contains 
headers plus a line saying 'No selected records found' if nothing selected 
is found?

>It can be done , however I need a few more details.

First thing first, many thanks for offering help.


>1. How are you selecting the data? (using INCLUDE/OMIT COND or OUTFIL 
INCLUDE/OMIT ?)

I am mostly using ICETOOL with both these two sets of statements or only 
with one, like this example with INCLUDE COND:

(PS - fields with @ are replaced by actual contents)

SORTFROM(INDD) TO(TEMP0003) USING(REST) 
DISPLAY FROM(TEMP0003) LIST(PRINT3R) - 
NOCC  - 
WIDTH(500)- 
BETWEEN(2)- 
TITLE('@PREFIX - @SYSTM: Active Ids') -
DATE(4MD/)- 
TIME(24:) - 
PAGE  - 
BLANK - 
ON(NUM,N05)   HEADER('NR')   - 
ON(10,8,CH)   HEADER('User id')  - 
ON(79,20,CH)  HEADER('User Name')- 
 

Re: DFSORT with empty outputs

2017-05-31 Thread Elardus Engelbrecht
Sri h Kolusu wrote:

>>>Is there a DFSORT or ICETOOL statement where the output contains headers 
>>>plus a line saying 'No selected records found' if nothing selected is found?

>It can be done , however I need a few more details.

First thing first, many thanks for offering help.


>1. How are you selecting the data? (using INCLUDE/OMIT COND or OUTFIL 
>INCLUDE/OMIT ?)

I am mostly using ICETOOL with both these two sets of statements or only with 
one, like this example with INCLUDE COND:

(PS - fields with @ are replaced by actual contents)

SORTFROM(INDD) TO(TEMP0003) USING(REST)
DISPLAY FROM(TEMP0003) LIST(PRINT3R) - 
NOCC  -
WIDTH(500)-
BETWEEN(2)-
TITLE('@PREFIX - @SYSTM: Active Ids') -
DATE(4MD/)-
TIME(24:) -
PAGE  -
BLANK -
ON(NUM,N05)   HEADER('NR')   - 
ON(10,8,CH)   HEADER('User id')  - 
ON(79,20,CH)  HEADER('User Name')- 
ON(100,8,CH)  HEADER('Dflt Group')   - 
ON(19,10,CH)  HEADER('Created')  - 
ON(118,10,CH) HEADER('Last Used') 

OCCUR  FROM(TEMP0003) LIST(PRINT3T) -   
   NOCC -   
   WIDTH(500)   -   
   ON(78,1,CH)  HEADER('Active Ids') -  
   ON(VALCNT,N05)   HEADER('Count') 

//RESTCNTL   DD * 
 SORT FIELDS=(10,8,CH,A)  
 INCLUDE COND=(5,4,CH,EQ,C'0200',AND, 
   54,4,CH,NE,C'YES ',AND,
   118,10,CH,NE,C'  ',AND,
   118,10,CH,NE,19,10,CH,AND, 
   100,8,CH,EQ,C'@GROEP',AND, 
   10,3,CH,EQ,C'@PREFIX') 

With these ICETOOL statements, when there is nothing I get this lame output:


* Top of Data *
XYZ - SYSTEM: Active Ids2017/05/3113:37:55 
   
NR  User id   User Name Dflt Group  Created
--      --  -- 
Active IdsCount
--   --
 Bottom of Data ***

... resulting in unneeded queries from reviewers of these reports.


>2. What is the LRECL and RECFM of the dataset?

It should not matter, but output is generally LRECL=500 and RECFM=FB (see NOCC 
in above example)
Input for this specific example is a RACF Unloaded DB. RECFM=VB, LRECL=4096.

I am also using SMF unloaded dataset from IRRADU00 (LRECL=12288, RECFM=VB) as 
well other SMF data and other datasets.


>3. Does the header already exist in the input file and is it the first 2 
>records in the file? or can this be generated?

No. I prefer raw data without headers as input, so I can add headers at a later 
stage like this ICETOOL example above or simply omit headers for sending over 
as a CSV file.

Many thanks again!

Groete / Greetings
Elardus Engelbrecht

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: DFSORT with empty outputs

2017-05-30 Thread Sri h Kolusu
>>Is there a DFSORT or ICETOOL statement where the output contains headers 
plus a line saying 'No selected records found' if nothing selected is 
found?

Elardus,

It can be done , however I need a few more details.

1. How are you selecting the data? (using INCLUDE/OMIT COND or OUTFIL 
INCLUDE/OMIT ?)
2. What is the LRECL and RECFM of the dataset?
3. Does the header already exist in the input file and is it the first 2 
records in the file? or can this be generated?

Thanks,
Kolusu
DFSORT Development
IBM Corporation



From:   Elardus Engelbrecht <elardus.engelbre...@sita.co.za>
To: IBM-MAIN@LISTSERV.UA.EDU
Date:   05/30/2017 07:14 AM
Subject:    DFSORT with empty outputs
Sent by:IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>



Good day to all DFSORT gurus

Is there a DFSORT or ICETOOL statement where the output contains headers 
plus a line saying 'No selected records found' if nothing selected is 
found?

Something like this:

User id   User Name Dflt Group  Created Last Used 
    --  --  --
ABC001ABC USER  ABCDEF  2000-09-29  2017-05-29

But when nothing is found I would like to say this:

User id   User Name Dflt Group  Created Last Used 
    --  --  --
No ids found.


This is similar to zSecure where you can say:

newlist rds name=GRP, header=no, dd=grp,
  title='Users in group ABCDEF',empty='No users found in group ABCDEF', 
... 

For zSecure, you either get a list of results or a statement that report 
has no selected results.

Is there something for DFSORT/ICETOOL?

Many thanks in advance for  your kind help!

Groete / Greetings
Elardus Engelbrecht

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN






--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


DFSORT with empty outputs

2017-05-30 Thread Elardus Engelbrecht
Good day to all DFSORT gurus

Is there a DFSORT or ICETOOL statement where the output contains headers plus a 
line saying 'No selected records found' if nothing selected is found?

Something like this:

User id   User Name Dflt Group  Created Last Used 
    --  --  --
ABC001ABC USER  ABCDEF  2000-09-29  2017-05-29

But when nothing is found I would like to say this:

User id   User Name Dflt Group  Created Last Used 
    --  --  --
No ids found.


This is similar to zSecure where you can say:

newlist rds name=GRP, header=no, dd=grp,
  title='Users in group ABCDEF',empty='No users found in group ABCDEF', ... 

For zSecure, you either get a list of results or a statement that report has no 
selected results.

Is there something for DFSORT/ICETOOL?

Many thanks in advance for  your kind help!

Groete / Greetings
Elardus Engelbrecht

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN