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 

Build single output from multiple inputs
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Wed Feb 23, 2011 5:41 am    Post subject: Build single output from multiple inputs Reply with quote

Please find below my reqmt:
Input files :LRECL 133 FB
XXXX.file1.data
XXXX.file2.data
XXXX.file3.data
File content
Code:
XXXX.file1.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000008                                               
                 DELETED 00000005                                                 
XXXX.file2.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000058                                               
                 DELETED 00000000                                                 
XXXX.file3.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000658                                               
                 DELETED 00000000       


Output file :
LRECL 80 FB
File name Rec count

Code:
DATE : 2011-02-22 or any date format
XXXX.file1.data : WRITTEN - 00000008 DELETED 00000005 ( OR ZERO SUPPRESSED)
XXXX.file2.data : WRITTEN - 00000058 DELETED 00000000
XXXX.file3.data : WRITTEN - 00000658 DELETED 00000000 



Can anyone help me to acheive the result in SORT. My shop prefers SORT before ICETOOL.
_________________
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 23, 2011 12:40 pm    Post subject: Reply with quote

radkrish82,

Use the following DFSORT JCL which will give you the desired results. If you want the leading zeroes suppressed , use M10 instead of M11 in the TOT parm on trailer3.

Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD DSN=your input Fb 133 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:16C'0')),                 
  IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,NE,C' '),PUSH=(1:1,16)),     
  IFTHEN=(WHEN=(18,7,CH,EQ,C'WRITTEN'),OVERLAY=(134:26,8)),     
  IFTHEN=(WHEN=(18,7,CH,EQ,C'DELETED'),OVERLAY=(142:26,8))       
                                                                 
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                         
  HEADER1=('DATE : ',DATE=(4MD-),/),                             
  SECTIONS=(1,16,                                               
  TRAILER3=(1,16,' : WRITTEN - ',TOT=(134,8,ZD,M11,LENGTH=10),   
            ' DELETED - ',TOT=(142,8,ZD,M11,LENGTH=10)))         
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
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: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Feb 23, 2011 1:18 pm    Post subject: Reply with quote

Radkrish82,

I see that you are really good at cross posting the same question across multiple helpboards. Read this

http://www.mvsforums.com/helpboards/viewtopic.php?t=8248

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Wed Feb 23, 2011 8:52 pm    Post subject: Reply with quote

Thanks, Kolusu. The main reason for cross posting is, most of the times mvsforum doesn't open in my office desk network. I have to walk to library to post my queries. becoz of work, if I am not able to leave my seat, i search for other forums. Hence you find cross posting. no other reasons. I requested my admin to permanently allow this web at my desk network. so that I can use this reliable forum all time from my desk itself.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Feb 24, 2011 1:20 am    Post subject: Reply with quote

radkrish82,

I suggest you spend time reading the manuals and not just depend on someone to help you. We canNOT spoon feed you all the time.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 2:00 am    Post subject: Reply with quote

Kolusu, 133 report for me comes as FBA. sry for rework.
I increased one byte to positions. But I am not getting desired output. count is also not matching.

Code:
SORT FIELDS=COPY                                                 
INREC IFTHEN=(WHEN=INIT,OVERLAY=(135:16C'0')),                   
IFTHEN=(WHEN=GROUP,BEGIN=(2,5,CH,NE,C' '),PUSH=(2:1,16)),       
IFTHEN=(WHEN=(19,7,CH,EQ,C'WRITTEN'),OVERLAY=(135:27,8)),       
IFTHEN=(WHEN=(19,7,CH,EQ,C'DELETED'),OVERLAY=(143:27,8))         
                                                                 
OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                           
HEADER1=('DATE : ',DATE=(4MD-),/),                               
SECTIONS=(2,16,                                                 
TRAILER3=(2,16,' : WRITTEN - ',TOT=(135,8,ZD,M11,LENGTH=8),     
          ' DELETED - ',TOT=(143,8,ZD,M11,LENGTH=8)))


Actual output
Code:

 Command ===>                                               
----+----1----+----2----+----3----+----4----+----5----+----6
********************************* Top of Data **************
DATE : 2011-02-24                                           
                                                           
            RCDS : WRITTEN - 00008290 DELETED - 00000000   
******************************** Bottom of Data ************



My desired output
Code:

DATE : 2011-02-22
XXXX.file1.data : WRITTEN - 00000008 DELETED 00000005
XXXX.file2.data : WRITTEN - 00000058 DELETED 00000000
XXXX.file3.data : WRITTEN - 00000658 DELETED 00000000   


File name should also come since I am giving 3 reports in concatenation to SORTIN.


Actual Report content looks like the one given below and also the one given in my prev post.
Code:
 XXXXX 08           0                       
 XXXXX 09           1  83604S67             
 XXXXX 10           0                       
 TOTALS              4                       
YYYYYY-XXX  02/22/2011                   
   NO OF RECORDS FOR THIS RUN.             
          ZZZZZZZ TOTALS FOR RPT TESTREPORT   
            RCDS WRITTEN 00000058             
            RCDS DELETED 00000000             


For 3 or more files in concatenation, will it work, since it merges together in input. or do we need to follow different SORT steps. Pls advise.
Maximum files upto 10. File output should differentiate record written/deleted for each files. Sorry for the trouble and am clear with the reqmt now.
Back to top
View user's profile Send private message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 2:06 am    Post subject: Reply with quote

Also, I am not sure, If we concatenate 3 files, sort can be able to differentiate each files.
Back to top
View user's profile Send private message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 2:19 am    Post subject: Reply with quote

All files looks similar except the data content in it. Eg., previous day report, prev to previous day report are available. Hence I need to differentiate each count for each files. Pls help me in this case.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Feb 24, 2011 12:07 pm    Post subject: Reply with quote

radkrish82 wrote:
All files looks similar except the data content in it. Eg., previous day report, prev to previous day report are available. Hence I need to differentiate each count for each files. Pls help me in this case.


Radkrish82,

When you concatenate the files , there is no way to distinguish the records. But I guess we can use the 'date field' on 'YYYYYY-XXX 02/22/2011' record as identifier and get the desired results

Doe each file have a record which starts with YYYYY? followed by a date? Can you have multiple YYYYY records in a single file?

If the YYYYY records are unique , then what is the position of the date and format of the date?

And you need to do a better job of explaining your requirements properly.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 12:43 pm    Post subject: Reply with quote

Quote:
Doe each file have a record which starts with YYYYY? followed by a date? Can you have multiple YYYYY records in a single file?

All files have record starting with YYYYY followed by date.
Yes, we have multiple yyyy records. Basically its a report name. So it is same for all files tht am taking into account. we can't differentiate in that matter. Similar dates is found in two or more files.

Quote:
If the YYYYY records are unique , then what is the position of the date and format of the date?

Its not unique.

A report is splitted into more than two files based on report indicator in the actual report on first position. I am taking the count of splitted files and not bother about the report. eg., if 3 files are splitted, then all files will have same report name and date. In this case, i can differentiate first file as file1, second as file2 and third as file3 inorder to show a count of all 3 files in single dataset.

Without concatenation, using SORT, Is there any function/control card like we use to count total number of records in a multple file eg., COUNT from(infile) write(output) text('file1-) char(8 ) digits(8 )
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Feb 24, 2011 12:54 pm    Post subject: Reply with quote

radkrish82 wrote:
Without concatenation, using SORT, Is there any function/control card like we use to count total number of records in a multple file eg., COUNT from(infile) write(output) text('file1-) char(8 ) digits(8 )


Read the documentation of COUNT function of ICETOOL with examples here

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA50/7.5
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 2:11 pm    Post subject: Reply with quote

Or can we go by following to acheive the result.
1. 3 input files 3 output files
2. Use include condition to filter only WRITTEN and DELETED record
3. Build outrec or outrec fields=(C:'file1:',27,8,66x)
4. concatenate these 3 output files to have single output file containing all these counts

But "DELETED" will be on second line next to WRITTEN. how to PUSH to first line?

Or any other ways to acheive this result pls.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Feb 24, 2011 2:25 pm    Post subject: Reply with quote

radkrish82,

I am not sure as to why you need to complicate a simple requirement. You said the input files are the output files from a split job. Why can't you get this report in the same split job itself? Why the additional concatenation and merging?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Feb 24, 2011 2:55 pm    Post subject: Reply with quote

There is an excess of machine resources that needs to be used. . . 8)

Last edited by papadi on Thu Feb 24, 2011 11:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
radkrish82
Beginner


Joined: 19 Feb 2009
Posts: 50
Topics: 10

PostPosted: Thu Feb 24, 2011 8:54 pm    Post subject: Reply with quote

Kolusu, The split job is running from production. shouldn't be disturbed. The adhoc request is to take the resulted split files and put the necessary count into catlgd dataset. For adhoc, we don't write a program. So we are trying to satisfy the reqmt within SORT. If someone can pls update me how to push the second line (DELETED) to first line within same FB LRECL 80. Or if you have any other alternate solution rather than complicated one I mentioned, I will be happy to use it. Thanks for all your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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