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 

need total number of records & system date in sep file
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Fri Jan 31, 2003 12:08 pm    Post subject: Reply with quote

As a sanity check, both of the jobs above produce a RECFM=FBA, LRECL=44 data set with DFSORT as well. They should because OUTREC=(43X) and INREC FIELDS=(43X) set the SORTOUT LRECL to the length of the reformatted record + 1 byte for the ANSI cc, so that's 43 due to the 43 blanks + 1 = 44.
_________________
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
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Sat Feb 01, 2003 11:55 am    Post subject: Reply with quote

Frank/Kolusu

It did work both the ways.. I was referring the wrong file.. Sorry for the inconvenice.

Thanks a lot for ur valuble response.
Back to top
View user's profile Send private message
zornet57
Beginner


Joined: 07 May 2003
Posts: 7
Topics: 2
Location: Seattle

PostPosted: Wed May 07, 2003 3:20 pm    Post subject: Reply with quote

Hi all -

I've looked and don't see a posting that fits my needs quite exactly(they dance all around it though..)

Our shop has Syncsort only.
I've created a data file, and with Syncsort I want to sort it, rearrange it, include only certain records, and add a 1-line trailer at the bottom of the file that is simply the total record count.

I can accomplish the 1st 3 easily with syncsort but am having trouble trying to figure out how to create the trailer. The examples admirably show how to create a =separate= trailer file but that's not what I need.

E.g. I want the file to look more or less like this:

datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadata
..
..
datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadata
datadatadatadatadatadatadatadatadatadatadatadatadatadatadatadata
00000284

Can anyone help? I really want to solve this using a utility and not have to write a stupid teeny-weeny program to do this. Thanks!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed May 07, 2003 4:58 pm    Post subject: Reply with quote

zornet57,
The following JCL will give you the desired results with a 8 byte count with leading zeroes supressed as the last record.However I want to add that the output created will be FBA. Since we are using the report feature TRAILER1, it will add the print character. so if your input file has an LRECL OF 80 and is of RECFM FB then the sortout will have an LRECL OF 81 and RECFM of FBA.DFSORT has a feature 'REMOVECC' which will eliminate the printing of carriage control character,but unfortunately syncsort does not support it.If you want carriage control to be removed then let me know and I will post another solution.

Code:

//STEP010  EXEC  PGM=SORT       
//SYSOUT   DD SYSOUT=*         
//SORTIN   DD DSN=YOUR INPUT DSN,
//            DISP=SHR
//SORTOUT  DD YOUR OUTPUT DATASET,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)         
//SYSIN    DD    *             
  SORT FIELDS=COPY       
  OUTFIL TRAILER1=(COUNT)
/*


Hope this helps...

cheers

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


Joined: 07 May 2003
Posts: 7
Topics: 2
Location: Seattle

PostPosted: Wed May 07, 2003 5:57 pm    Post subject: Reply with quote

Thanks kolusu!

I tried it, though, and got this message:
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING

So, I changed my SORTOUT DD RECFM parm to FBA and it worked fine. However, as you mentioned, the carriage control character is now in the entire file and I need to remove it. I guess one answer is to do a second sort and get rid of it.... but do you have another solution?? Thanks again!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu May 08, 2003 8:50 am    Post subject: Reply with quote

Zornet,

The following JCL will give you the desired results. A brief explanation of the job. The first step copies the input to output as is and also creates another file with just the total no: of records in the file. This file will have the carriage control and will have the RECFM FBA.

Now the second step takes in the count file and strips the carriage control character and APPENDS(disp=mod) it to the output file which we created in the previous step.
Code:

//STEP010  EXEC  PGM=SORT                                           
//SYSOUT   DD  SYSOUT=*                                             
//SORTIN   DD DSN=YOUR INPUT DSN,
//            DISP=SHR                                                     
//OUT      DD DSN=YOUR OUTPUT DATASET,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TRAIL    DD DSN=&TEMP DSN WITH COUNT,
//            DISP=(,PASS),
//            SPACE=(TRK,(1,1),RLSE)                   
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  OUTFIL FNAMES=OUT                                                   
  OUTFIL FNAMES=TRAIL,NODETAIL,TRAILER1=(COUNT)                       
/*                                                                   
//STEP020  EXEC  PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&TEMP DSN WITH COUNT,
//            DISP=OLD                                       
//SORTOUT  DD DSN=YOUR OUTPUT DATASET,
//            DISP=(MOD,CATLG,DELETE)               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY
  INREC FIELDS=(2,80)                                                 
/*                   


If you want the leading zeroes for your count, then change the sysin card for step020 to the following
Code:

  SORT FIELDS=COPY                                                     
  INREC FIELDS=(2,08,FS,ZD,LENGTH=8,  $ CONVERT COUNT WITH LEADING 0 
                80:X)                                                 


Hope this helps...

cheers

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


Joined: 07 May 2003
Posts: 7
Topics: 2
Location: Seattle

PostPosted: Fri May 09, 2003 3:02 pm    Post subject: Reply with quote

Thanks very much! I kinda suspected I'd just have to do a 2nd sort to get rid of that cc character. Your help is appreciated.
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 Previous  1, 2
Page 2 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