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 

Left Justifying Section Count Field using Sort

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


Joined: 29 Jun 2017
Posts: 6
Topics: 6

PostPosted: Fri Oct 27, 2017 10:33 am    Post subject: Left Justifying Section Count Field using Sort Reply with quote

Hi,
Please find the below sort card to display department-wise count of records.

Code:

OPTION COPY                                   
INREC  IFTHEN=(WHEN=GROUP,                   
               BEGIN=(2,6,CH,EQ,C'ABC123'),   
               PUSH(137:101,8)),             
       IFTHEN=(WHEN=GROUP,                   
               BEGIN=(2,05,CH,EQ,C'BATCH'),   
               PUSH(134:8,3))                 
                                             
OUTFIL INCLUDE=(028,02,CH,EQ,C'21',AND,       
                134,01,SS,EQ,C'0,1',AND,     
                ((134,3,ZD,GT,010,AND,       
                  134,3,ZD,LT,077),OR,       
                 (134,3,ZD,GT,080,AND,       
                  134,3,ZD,LT,106),OR,       
                 (134,3,ZD,GT,120,AND,       
                  134,3,ZD,LT,136))),         
       REMOVECC,                             
       NODETAIL,                             
       SECTIONS=(8,3,                         
       TRAILER3=(1X,137,8,1X,8,3,2X,
       COUNT=(M10,LENGTH=8)))       


Output :
Code:

----+----1----+----2---
***********************
10-24-17 031                  83
10-24-17 033                   2
10-24-17 051                 663
10-24-17 088                  81
***********************

Description:
In the above sort card, sections is used to calculate department-wise count of records.
I am getting the count as right justified.
I want to display the count(Position : 16 to 23) to be left justified.
I tried with OVERLAY,JFY=(SHIFT=LEFT) within sections, but it is not working.
Can you please advise me to get the below expected output.

Expected Output :
Code:

10-24-17 031  83
10-24-17 033  2
10-24-17 051  663
10-24-17 088  81
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Oct 27, 2017 11:28 am    Post subject: Reply with quote

sublak123,

Looks like you still cannot seem to follow the rules.

https://www.mvsforums.com/helpboards/viewtopic.php?p=62485#62485

I added the code tags for you this time. From the next time , I expect you to follow the rules.

Coming to the topic you cannot use JFY/SQZ on the count on trailer. So you need to do it differently.

Move your OUTFIL INCLUDE as another IFHTEN and add an 8 byte seqnum with FS format and then JFY on that.

Something like this Untested code

Code:

//SYSIN    DD *                                       
  OPTION COPY                                         
  INREC  IFTHEN=(WHEN=GROUP,                         
                 BEGIN=(2,6,CH,EQ,C'ABC123'),         
                 PUSH(137:101,8)),                   
         IFTHEN=(WHEN=GROUP,                         
                 BEGIN=(2,05,CH,EQ,C'BATCH'),         
                 PUSH(134:8,3)),                     
                                                     
         IFTHEN=(WHEN=(028,02,CH,EQ,C'21',AND,       
                      134,01,SS,EQ,C'0,1',AND,       
                      ((134,3,ZD,GT,010,AND,         
                        134,3,ZD,LT,077),OR,         
                       (134,3,ZD,GT,080,AND,         
                        134,3,ZD,LT,106),OR,         
                       (134,3,ZD,GT,120,AND,         
                        134,3,ZD,LT,136))),   
       
             OVERLAY=(146:SEQNUM,8,FS,RESTART=(8,3),         
                      146:146,8,JFY=(SHIFT=LEFT)))   
                                                     
         OUTFIL REMOVECC,NODETAIL,     
         INCLUDE=(146,1,CH,GT,C' '),               
         SECTIONS=(8,3,                               
         TRAILER3=(1X,137,8,1X,8,3,2X,146,8))         
                                                 

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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