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 

SYNCSORT FORMATING OF RECORDS?

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


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Tue Oct 16, 2007 1:36 pm    Post subject: SYNCSORT FORMATING OF RECORDS? Reply with quote

Hi,
I am having the file with FB of length 80.The i/p is like below.

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+
***************************** Top of Data ***********************
11 1234       123456     01 KY    2000.10 1234516 2570111 RJ123 
11 1234       123456     02 KY    2000.90 1234515 3570122 RJ234 
12 1235       123451     03 KJ    3000.10 1234543 9570133 RJ123 
12 1235       1234       04 KJ    1000.90 1235462 8570144 RJ237 


This need to be converted like below.


Code:


----+----1----+----2----+----3----+----4----+----5----+----6----+
***************************** Top of Data ***********************
11 1234        TST          002 000400100                 RJ123 
11 1234       123456     01 KY 0002000.10 1234516 2570111 RJ123 
11 1234       123456     02 KY 0002000.90 1234515 3570122 RJ234 
12 1235        TST          002 000400100                 RJ237 
12 1235       1234       04 KJ 0001000.90 1235462 8570144 RJ237 
12 1235       123451     03 KJ 0003000.10 1234543 9570133 RJ123 


The letters TST are fixed and should come for all the TOTALS records.

Thanks
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Oct 17, 2007 7:38 am    Post subject: Reply with quote

bprasanna,

I succeeded in formatting but couldnt accomplish the record count and the summation.

Idea is to use sections.

Code:


  //STEP0001 EXEC PGM=SORT                                       
//SYSOUT  DD SYSOUT=*                                           
//SORTIN DD *                                                   
11 1234       123456     01 KY    2000.10 1234516 2570111 RJ123
11 1234       123456     02 KY    2000.90 1234515 3570122 RJ234
12 1235       123451     03 KJ    3000.10 1234543 9570133 RJ123
12 1235       1234       04 KJ    1000.90 1235462 8570144 RJ237
/*                                                             
//SORTOUT DD SYSOUT=*                                           
//SYSIN DD *                                                   
  SORT FIELDS=(1,18,CH,A)                                       
  OUTFIL REMOVECC,                                             
  SECTIONS=(1,18,                                               
  HEADER3=(1,10,C'     TST    ',36X,59,10))                     
/*                                                             


_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Oct 17, 2007 8:16 am    Post subject: Reply with quote

sum of cloumn can be found using TOT function. Search for this is teh board. You may get some replies on how to add columns.
Back to top
View user's profile Send private message Send e-mail
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Oct 17, 2007 1:25 pm    Post subject: Reply with quote

Hi,
I checked the forum ,but I don't see any thing to write the TOT as the initial line.
All the TOT is happening at the end with TRAILER options.Can this be done thru
IBM sort? I am just curious to know this one.

Thanks
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Oct 19, 2007 1:10 am    Post subject: Reply with quote

bprasanna
TOT, COUNT.. are the features available with the trailer option not with Header. So, incase you need to add total in the header then use this SORT JOB
Code:
//******************************************************************** 
//S1       EXEC  PGM=ICEMAN                                             
//SYSOUT   DD  SYSOUT=*                                                 
//SORTIN   DD *                                                         
11 1234       123456     01 KY    2000.10 1234516 2570111 RJ123         
11 1234       123456     02 KY    2000.90 1234515 3570122 RJ234         
12 1235       123451     03 KJ    3000.10 1234543 9570133 RJ123         
12 1235       1234       04 KJ    1000.90 1235462 8570144 RJ237         
/*                                                                     
//SORTOUT DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA   
//SYSIN    DD    *                                                     
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
  SORT FIELDS=COPY                                                     
  OUTREC OVERLAY=(81:C'1')                                             
  OUTFIL REMOVECC,                                                     
    SECTIONS=(1,10,                                                     
      TRAILER3=(1,10,16:C'TST',29:COUNT=(EDIT=(TTT)),                   
             33:TOT=(33,10,UFF,EDIT=(TTTTTTTT.TT)),81:X))               
/*                                                                     
//S2       EXEC  PGM=ICEMAN                                             
//SYSOUT   DD  SYSOUT=*                                                 
//SORTIN   DD DSN=&&TEMP1,DISP=(MOD,PASS)                               
//SORTOUT  DD  SYSOUT=*                                                 
//SYSIN    DD    *                                                     
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
  SORT FIELDS=(1,10,A,81,1,A),FORMAT=CH                                 
  OUTREC BUILD=(1,80)                                                   
/*                                                                     

SORTOUT
Code:
11 1234        TST          002 00004001.00                                     
11 1234       123456     01 KY    2000.10 1234516 2570111 RJ123                 
11 1234       123456     02 KY    2000.90 1234515 3570122 RJ234                 
12 1235        TST          002 00004001.00                                     
12 1235       1234       04 KJ    1000.90 1235462 8570144 RJ237                 
12 1235       123451     03 KJ    3000.10 1234543 9570133 RJ123                 

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Oct 19, 2007 1:17 am    Post subject: Reply with quote

I prefer you have the this SORT card in the above SORT JOB in STEP:S2
Code:
SORT FIELDS=(1,10,A,81,1,A),FORMAT=CH,EQUALS

In the place of
Code:
SORT FIELDS=(1,10,A,81,1,A),FORMAT=CH

_________________
cHEERs
krisprems
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
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