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 

Add a summary trailer record at the end of the 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
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jan 19, 2006 10:56 am    Post subject: Reply with quote

Quote:

Yes, this JCL does work but the only problem is that the negative sign in the output "TOTAL AMOUNT VALUE" doesn't get displayed properly. It gets displayed as '}'.


heman,

Just use the similar change operator used in step0100.

change your step0200 sysin cards to the following

Code:

//SYSIN    DD *                                   
  SORT FIELDS=(1,1,CH,A)                           
  SUM FIELDS=(2,8,ZD,                             
              10,17,ZD)                           
  OUTFIL OUTREC=(C'TOTAL NUMBER OF RECORDS : ',   
                 2,8,/,                           
                 C'TOTAL AMOUNT VALUE      : ',   
                 10,15,                           
                 C'.',                             
                 25,01,                           
                 26,01,CHANGE=(2,C'}',C'0-',       
                                 C'J',C'1-',       
                                 C'K',C'2-',       
                                 C'L',C'3-',       
                                 C'M',C'4-',       
                                 C'N',C'5-',       
                                 C'O',C'6-',       
                                 C'P',C'7-',       
                                 C'Q',C'8-',       
                                 C'R',C'9-',       
                                 C'{',C'0 ',       
                                 C'A',C'1 ',       
                                 C'B',C'2 ',       
                                 C'C',C'3 ',       
                                 C'D',C'4 ',       
                                 C'E',C'5 ',       
                                 C'F',C'6 ',       
                                 C'G',C'7 ',       
                                 C'H',C'8 ',       
                                 C'I',C'9 '),     
                 80:X)                             

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


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Jan 19, 2006 11:07 am    Post subject: Reply with quote

Thanks a lot Kolusu. It works. Thanks a lot again. Smile
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jan 19, 2006 11:21 am    Post subject: Reply with quote

heman,

Correction. you don't need a change parameter in step0200. you can just use the EDIT function. Also I would use 18 digits to sum the amount value. So change your step0100 control cards to the following.

Code:

//SYSIN    DD *                                 
  SORT FIELDS=COPY                               
  OUTREC FIELDS=(C'1',                           
                 C'00000001',                   
                 C'0',                           
                 20,15,                         
                 36,01,                         
                 37,02,CHANGE=(1,C'0-',C'}',     
                                 C'1-',C'J',     
                                 C'2-',C'K',     
                                 C'3-',C'L',     
                                 C'4-',C'M',     
                                 C'5-',C'N',     
                                 C'6-',C'O',     
                                 C'7-',C'P',     
                                 C'8-',C'Q',     
                                 C'9-',C'R',     
                                 C'0 ',C'{',     
                                 C'1 ',C'A',     
                                 C'2 ',C'B',     
                                 C'3 ',C'C',     
                                 C'4 ',C'D',     
                                 C'5 ',C'E',     
                                 C'6 ',C'F',     
                                 C'7 ',C'G',     
                                 C'8 ',C'H',     
                                 C'9 ',C'I'))   
/*


And step0200 sysin cards to the following.

Code:

//SYSIN    DD *                                   
  SORT FIELDS=(1,1,CH,A)                           
  SUM FIELDS=(2,8,ZD,                             
              10,18,ZD)                           
  OUTFIL OUTREC=(C'TOTAL NUMBER OF RECORDS : ',   
                 2,8,/,                           
                 C'TOTAL AMOUNT VALUE      : ',   
                 10,16,                           
                 C'.',                             
                 26,02,ZD,EDIT=(TTS),SIGNS=(,,,-),
                 80:X)                             
/*


Hope this helps...

Cheers

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


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Thu Jan 19, 2006 4:48 pm    Post subject: Reply with quote

Hi Kolusu,

This has worked. Thanks for this.
I had a query. The sysout in the STEP0200 has LRECL of 80.
The actual purpose of doing this was to add the trailer record at the end of the file which is of length 48 bytes. Thus, I wanted the output of STEP0200 in a DSN of 48 bytes but it needs LRECL 80.
So, I have to code another step to extract it into a file with record length 48.

Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jan 19, 2006 9:38 pm    Post subject: Reply with quote

Quote:

The actual purpose of doing this was to add the trailer record at the end of the file which is of length 48 bytes. Thus, I wanted the output of STEP0200 in a DSN of 48 bytes but it needs LRECL 80. So, I have to code another step to extract it into a file with record length 48.


was it 38 byte file or 48 byte file? Any ways if you want a 48 byte file then you don't need another step to create it. simply change the 80:x at the end of step0200 sysin cards to 48:X and it will create a 48 byte file.

if you want 38 byte file then change the step0200 sysin cards to the following

Code:

//SYSIN    DD *                                     
  SORT FIELDS=(1,1,CH,A)                             
  SUM FIELDS=(2,8,ZD,                               
              10,18,ZD)                             
  OUTFIL OUTREC=(C'COUNT: ',                         
                 2,8,/,                             
                 C'TOTAL: ',                         
                 10,16,                             
                 C'.',                               
                 26,02,ZD,EDIT=(TTS),SIGNS=(,,,-),   
                 38:X)                               
/*                                                   


This will produce

Code:

COUNT: 00000004           
TOTAL: 0823088889788780.71


Hope this helps...

Cheers

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


Joined: 17 Aug 2005
Posts: 18
Topics: 4

PostPosted: Fri Jan 20, 2006 6:05 am    Post subject: Reply with quote

Thanks Kolusu. Thanks for all the effort in helping me out.
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