MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing Detail records and a new Summary record

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Wed Sep 29, 2010 10:04 am    Post subject: Writing Detail records and a new Summary record Reply with quote

Hi all,
Can somebuddy give me your hand on solving this problem?

My task is to find out how frequent the programs are being installed into the production environment. For an instance, the program AAAA is installed into the production environment 10 times (4 times for the "project 1" and 6 times for the "project 2").

I have written a assembly program to get the different details along with the Program name, Project name and Installation date and generated the following file.

O/p file from assembly program (LRECL 130):
Code:

AAAAProj1 2010-10-01xxxxxx (<--has other details)
AAAAProj2 2010-10-01xxxxxxxxx
AAAAProj2 2010-10-01xxxxxxxxx
  (Included a 'space' here for better readability)
BBBBProj32009-01-01xxxxxxxxx
BBBBProj32009-01-01xxxxxxxxx
BBBBProj32009-01-01xxxxxxxxx
BBBBProj12009-01-01xxxxxxxxx

CCCCProj42009-01-01xxxxxxxxx
CCCCProj42009-01-01xxxxxxxxx
CCCCProj42009-01-01xxxxxxxxx
CCCCProj42009-01-01xxxxxxxxx
CCCCProj42009-01-01xxxxxxxxx


Record layout:
Pos.1-4 - Program name
Pos.5-9 - Project name
Pos.11-21 - Installation date

Now, I am planning to use the SORT utility to get the following result.

Expected Output File: Contains the 'detail record' along with the 'summary record' for each 'program'.

Code:

AAAAProj12010-10-01
AAAAProj22010-10-01
AAAAProj22010-10-01

Module AAAA shipped 3 times
Module AAAA shipped 1X due to the project 1
Module AAAA shipped 2X due to the project 2

BBBBProj12009-01-01
BBBBProj32009-01-01
BBBBProj32009-01-01
BBBBProj32009-01-01

Module BBBB shipped 3 times
Module BBBB shipped 1X due to the project 1
Module BBBB shipped 3X due to the project 3

CCCCProj42009-01-01
CCCCProj42009-01-01
CCCCProj42009-01-01
CCCCProj42009-01-01
CCCCProj42009-01-01

Module CCCC shipped 5 times

Module CCCC shipped 5X due to the project 4   



Note: A space is required between the Summary record and the Detail record for better readability.

I have referred one of the previous posts (updated by Frank Yeager) and constructed the following ICETOOL JCL to accomplish my task.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD     *
AAAAPROJ12010-10-01
AAAAPROJ22010-10-01
AAAAPROJ22010-10-01
BBBBPROJ12010-10-01
BBBBPROJ32010-10-01
BBBBPROJ32010-10-01
BBBBPROJ32010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
//OUT DD SYSOUT=X
//TOOLIN   DD    *
SELECT FROM(IN) TO(OUT) ON(1,4,CH) ON(5,5,CH) LAST USING(CTL1)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,19,
    133:SEQNUM,5,FS,RESTART=(1,4))
  OUTFIL FNAMES=OUT,REMOVECC,
    SECTIONS=(1,4,
     TRAILER3=(/,1,4,12:COUNT=(M10,LENGTH=5),
             33:133,5,/))
/*


This is not giving the same result what I am expecting. I know I am doing some stupied mistakes but not able to figure out how to fix this problem! At present, I am reading the manual to check is their anyway to solve this issue.

Please do let me if you have any thoughts on this!


Note:
At present, the TRAILER3 section contains the following:
1. Program Name
2. No. of times it is installed for the given 'project'
3. Total number of times the program installed into the production environment. I am yet to update the following phrase in the TRAILER3 section. Let me try to get the desired result first and then I believe it will be easy for me to incorporate the below phrase.
Module <XXXX> shipped <N> times
Module <XXXX> shipped <NX> due to the <project>
Module <XXXX> shipped <NX> due to the <project>

Much appreciated your thoughts on this!
Back to top
View user's profile Send private message Yahoo Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Sep 29, 2010 10:34 am    Post subject: Reply with quote

as this is posted in the utilities as apposed to DFSORT forum I will make a comment.

why have you not provided us with the output of your run?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Thu Sep 30, 2010 11:38 am    Post subject: Reply with quote

mmprasadh,
Is there a limit to total number of projects? like 10 or 20?

Thanks,
Back to top
View user's profile Send private message
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Fri Oct 01, 2010 6:17 am    Post subject: Reply with quote

My apology to all! My a/c was innactive for a day since I changed few things on my profile; not able to check the status!

@dbzTHEdinosauer , My apology! By using the above JCL, I have got the o/p as follows:

Input:
Code:

AAAAPROJ12010-10-01
AAAAPROJ22010-10-01
AAAAPROJ22010-10-01
BBBBPROJ12010-10-01
BBBBPROJ32010-10-01
BBBBPROJ32010-10-01
BBBBPROJ32010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01
CCCCPROJ42010-10-01



Output:
Code:

AAAAPROJ12010-10-01
AAAAPROJ22010-10-01

AAAA           2                    3

BBBBPROJ12010-10-01
BBBBPROJ32010-10-01

BBBB           2                    4

CCCCPROJ42010-10-01

CCCC           1                    5



Summary record contents:
1. Program Name
2. Number of times the program installed for the PARTICULAR project.
3. Total number of times the program is installed into the production


Quick Explanation: This is not exactly producing the result what I want. For example, my JCL is not producing the summary record for the first AAAA entry (AAAAPROJ12010-10-01). The summary record is producing only for the last instance of the program AAAA. Also, it is not writing all the detail records into the o/p file (along with the summary record). Will try to check the forum again to see has anybody come across such problems!


@Sqlcode: There is not limit on the projects. For example, a given program can be edited many times over the years for different projects.
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Oct 01, 2010 11:20 am    Post subject: Reply with quote

mmprasadh,

It gets trickier with 2 level break and also the detail records to accommodate in a single pass of data. Here is a 2 step approach which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input lrecl 130 FB file,DISP=SHR
//SORTOUT  DD DSN=&&DTL,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)     
//LVLBRK   DD DSN=&&LVL,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)     
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  OUTREC OVERLAY=(131:1,4,C'1')                                 
  OUTFIL REMOVECC,                                             
  SECTIONS=(1,4,                                               
  TRAILER3=(131:1,4,C'2',/,'MODULE ',1,4,' SHIPPED ',           
            COUNT=(M10,LENGTH=5),' TIMES',131:131,4,C'3'))     
                                                               
  OUTFIL FNAMES=LVLBRK,REMOVECC,NODETAIL,                       
  SECTIONS=(1,9,                                               
  TRAILER3=('MODULE ',1,4,' SHIPPED ',COUNT=(M10,LENGTH=5),     
            'X DUE TO THE ',5,5,131:131,4,C'4',/,131:1,4,C'5'))
//*                                                             
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=&&DTL,DISP=SHR                               
//         DD DSN=&&LVL,DISP=SHR                               
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=(131,5,CH,A),EQUALS                               
  OUTREC BUILD=(1,130)                                         
//*


The output from this job with the test data is
Code:

AAAAPROJ1 2010-10-01                           
AAAAPROJ2 2010-10-01                           
AAAAPROJ2 2010-10-01                           
                                               
MODULE AAAA SHIPPED     3 TIMES                 
MODULE AAAA SHIPPED     1X DUE TO THE PROJ1     
MODULE AAAA SHIPPED     2X DUE TO THE PROJ2     
                                               
                                               
BBBBPROJ1 2010-10-01                           
BBBBPROJ3 2010-10-01                           
BBBBPROJ3 2010-10-01                           
BBBBPROJ3 2010-10-01                           
                                               
MODULE BBBB SHIPPED     4 TIMES                 
MODULE BBBB SHIPPED     1X DUE TO THE PROJ1     
MODULE BBBB SHIPPED     3X DUE TO THE PROJ3     
                                               
                                               
CCCCPROJ4 2010-10-01                           
CCCCPROJ4 2010-10-01                           
CCCCPROJ4 2010-10-01                           
CCCCPROJ4 2010-10-01                           
CCCCPROJ4 2010-10-01                           
                                               
MODULE CCCC SHIPPED     5 TIMES                 
MODULE CCCC SHIPPED     5X DUE TO THE PROJ4     
                                               

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Mon Oct 04, 2010 11:39 am    Post subject: Reply with quote

Thanks a bunch Kolusu!
A quick question? I tried to run the above JCL and received the following error:

Code:

ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE230A 0 135 BYTE HEADER/TRAILER RECORD EXCEEDS 130 BYTE LRECL FOR SORTOUT
ICE751I 0 C5-K51707 C6-K51707 C7-K51707 C8-K51707 E9-K51707 E7-K51707
ICE052I 3 END OF DFSORT

Note:My input files LRECL is FB 130 bytes


Then, I've included the DCB in SORTOUT DD and ran the job. It went through!

Code:

//SORTOUT  DD DSN=&&DTL,DISP=(,PASS),SPACE=(CYL,(9,9),RLSE),
//            DCB=(RECFM=FB,LRECL=135)


Is this correct? It means, DFSORT will throw the error message if the LRECL of SORTOUT is more than the LRECL of the SORTIN. And we need to explicitly code the DCB of the SORTOUT in the JCL!
Back to top
View user's profile Send private message Yahoo Messenger
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Mon Oct 04, 2010 11:44 am    Post subject: Reply with quote

A correction on my previous update! I've rephrased my understanding again!



DFSORT will throw the error message if the LRECL of SORTOUT is NOT EQUAL to the LRECL of the SORTIN! I believe, we need to explicitly code the DCB of the SORTOUT in the JCL if their is a difference in LREC?

Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Oct 04, 2010 11:47 am    Post subject: Reply with quote

Quote:

Is this correct? It means, DFSORT will throw the error message if the LRECL of SORTOUT is more than the LRECL of the SORTIN. And we need to explicitly code the DCB of the SORTOUT in the JCL!


mmprasadh,

No. You don't have to explicitly code the LRECL in the JCL. Use the BUILD, OVERLAY, IFTHEN, or IFOUTLEN operand to force a length for the data records that is longer than any report record, and either let DFSORT compute and set the LRECL, or ensure that the computed LRECL is equal to the existing or specified LRECL.

Your input file length is 130 , so DFSORT assumes that your header/trailer are also within that limit. If you have header/trailer greater than 130 , use BUILD/OVERLAY to specify the length.

If your input lrecl is 130 why are you creating a 135 byte header/trailer? And which step are you trying to do this?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Mon Oct 04, 2010 6:31 pm    Post subject: Reply with quote

Excuse me Kolusu!

As per your JCL, I've created the 130 FB input file and ran your JCL. But, it has thrown me the error message which I've shared you the details on my previous post. Then, I've included the DCB parameter in the SORTOUT DD of the step STEP0100 and ran the job successfully.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input lrecl 130 FB file,DISP=SHR
//SORTOUT  DD DSN=&&DTL,DISP=(,PASS),SPACE=(CYL,(9,9),RLSE),
//            DCB=(RECFM=FB,LRECL=135)
//LVLBRK   DD DSN=&&LVL,DISP=(,PASS),SPACE=(CYL,(9,9),RLSE)     
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  OUTREC OVERLAY=(131:1,4,C'1')                                 
  OUTFIL REMOVECC,                                             
  SECTIONS=(1,4,                                               
  TRAILER3=(131:1,4,C'2',/,'MODULE ',1,4,' SHIPPED ',           
            COUNT=(M10,LENGTH=5),' TIMES',131:131,4,C'3'))     
                                                               
  OUTFIL FNAMES=LVLBRK,REMOVECC,NODETAIL,                       
  SECTIONS=(1,9,                                               
  TRAILER3=('MODULE ',1,4,' SHIPPED ',COUNT=(M10,LENGTH=5),     
            'X DUE TO THE ',5,5,131:131,4,C'4',/,131:1,4,C'5'))
//*                 


I think we need to include DCB in SORTOUT DD since we are updating the count from Pos.131 to 135?
Back to top
View user's profile Send private message Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Oct 04, 2010 7:03 pm    Post subject: Reply with quote

When I run the equivalent of your job without the DCB parameters using DFSORT, it runs just fine. Please remove the DCB parameters, run the job again, and show the complete JES log here.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Oct 04, 2010 7:24 pm    Post subject: Reply with quote

mmprasadh,

I am guessing that your site has changed the default for the SOLRF option from YES to NO which does not let DFSORT calculate the length from INREC/OUTREC/OUTFIL.

Change this statement
Code:

OPTION COPY

to

Code:

OPTION COPY,SOLRF


and re-run your job removing the LRECL in JCL. Now DFSORT should automatically calculate the length for you.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Mon Oct 11, 2010 5:44 pm    Post subject: Reply with quote

Very sorry for the delayed reply Kolusu! Was very busy on production related issues.

I have tried your suggestion of including the option SOLRF in the SORT card but still it is giving the same error message. I have posted the below error message FYR.

Code:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 16:43 ON MON OC
            OPTION COPY,SOLRF
            OUTREC OVERLAY=(131:1,4,C'1')
            OUTFIL REMOVECC,
            SECTIONS=(1,4,
            TRAILER3=(131:1,4,C'2',/,'MODULE ',1,4,' SHIPPED ',
                      COUNT=(M10,LENGTH=5),' TIMES',131:131,4,C'3'))
            OUTFIL FNAMES=LVLBRK,REMOVECC,NODETAIL,
            SECTIONS=(1,9,
            TRAILER3=('MODULE ',1,4,' SHIPPED ',COUNT=(M10,LENGTH=5),
                      'X DUE TO THE ',5,5,131:131,4,C'4',/,131:1,4,C'5'))
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE230A 0 135 BYTE HEADER/TRAILER RECORD EXCEEDS 130 BYTE LRECL FOR SORTOUT
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E9-K51707 E7-K51707
ICE052I 3 END OF DFSORT


Infact, the pos.131-135 is being used to maintain the count of the modules. So, I should not get such error message. Interestingly, I am didn't get any error message when I ran the ICETOOL JCL ( that I've posted you initially). Please do let me know if I miss anything!

Note: I am using the input with LRECL as 130.



Hi Kolusu,
I have one more query on this!

The report should be formatted in a sequential order with most
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Oct 12, 2010 11:21 am    Post subject: Reply with quote

mmprasadh,

I couldn't replicate your error on my system. Can you send the complete sysout along with jes messages from the 2(the one you said works with icetool and the other which doesn't) jobs to skolusu@us.ibm.com ? We will take a look at it

It is very easy to get the report as you want but lets fix the initial issue.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mmprasadh
Beginner


Joined: 16 May 2005
Posts: 9
Topics: 2
Location: Somewhere on Earth.. :-)

PostPosted: Mon Oct 18, 2010 10:52 am    Post subject: Reply with quote

Hi Kolusu,
I sent a mail to you with all the details. Just done few more testing and found that the job is erroring with U0016 if and only if I don't give the DCB for the SORTOUT DD. But, I changed the JCL to write the intermediate records into the new DD called SORTOUTX (instead of SORTOUT) and ran the job. It went through and received the expected output!

I am really not sure whether the DCB parameter should be coded to the SORTOUT DD all the time.

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=Your input lrecl 130 FB file,DISP=SHR
//SORTOUTX DD DSN=&&DTL,DISP=(,PASS),SPACE=(CYL,(9,9),RLSE),
//            DCB=(RECFM=FB,LRECL=135)
//LVLBRK   DD DSN=&&LVL,DISP=(,PASS),SPACE=(CYL,(9,9),RLSE)     
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  OUTREC OVERLAY=(131:1,4,C'1')                                 
  OUTFIL FNAMES=SORTOUTX,REMOVECC,                                             
  SECTIONS=(1,4,                                               
  TRAILER3=(131:1,4,C'2',/,'MODULE ',1,4,' SHIPPED ',           
            COUNT=(M10,LENGTH=5),' TIMES',131:131,4,C'3'))     
                                                               
  OUTFIL FNAMES=LVLBRK,REMOVECC,NODETAIL,                       
  SECTIONS=(1,9,                                               
  TRAILER3=('MODULE ',1,4,' SHIPPED ',COUNT=(M10,LENGTH=5),     
            'X DUE TO THE ',5,5,131:131,4,C'4',/,131:1,4,C'5'))
//* 


Also, my requirement has slightly changed but I am curious to know the DCB issue first. I will then post my 'requirment change' separately.

Once again thanks to Kolusu and to all! Please do provide some light on this!
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group