Mainframe - Dynamic sort card building with trailer record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Mainframe - Dynamic sort card building with trailer record

Postby Dambaattam » Mon Apr 20, 2020 6:50 pm

Team,
I am trying to add the trailer record to build TRL and date and time in the output DYNAMIC sort card but getting lot of errors. could anyone please help on this

I have the input file as like below

xxxxxxxx 20200412101223
yyyyyyyy 20200312101128

Sort card to prepare a dynamic Sort card
SYSIN DD *
OPTION COPY
INCLUDE COND=(1,8,CH,EQ,C'XXXXXXXX')
OUTFIL REMOVECC,
HEADER1=('SORT FIELDS=(57,8,ZD,D)'),
BUILD=(C' INCLUDE COND=((57,8,ZD,GT,',9,8,C'),OR,',40X,/,
C' (57,8,ZD,EQ,',9,8,C',AND,65,6,ZD,GT,',17,6,C')),
C('TRAILER1=('TRL',DATE=(4MD/),TIME=(24)))')


output what i expect

SORT FIELDS(57,8,ZD,D)
INCLUDE COND=((57,8,ZD,GT,20200421), OR,
(57,8,ZD,EQ,20200421,AND,65,6,ZD,GT,101223))
TRAILER1=('TRL',DATE=(4MD/),TIME=(24))


EXCEPT THE TRAILER, ITS WORKING FINE. TRAILER IS GIVING LOT OF SYNTAX ERRORS IN THE TRAILER LINE RC 0008

Thanks in Advance
Dambaattam
 
Posts: 7
Joined: Thu May 15, 2014 4:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Mainframe - Dynamic sort card building with trailer reco

Postby sergeyken » Mon Apr 20, 2020 8:08 pm

RTFM:
TRAILERx=(field1,field2,...,fieldn)

&DATE[±nnnn]
&DATE=(m1m2m3m4)[±nnnn]
&DATENS=(xyz)[±nnnn]
&YDDD=(m1m2m3)[±nnnn]
&YDDDNS=(m1m2)[±nnnn]
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Mainframe - Dynamic sort card building with trailer reco

Postby sergeyken » Mon Apr 20, 2020 8:25 pm

Dambaattam wrote:TRAILER IS GIVING LOT OF SYNTAX ERRORS IN THE TRAILER LINE RC 0008

WTF???
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Mainframe - Dynamic sort card building with trailer reco

Postby NicC » Mon Apr 20, 2020 9:58 pm

1 - use the code tags to present your code. As it is posted your control statements start in cc1 which is reserved for labels and your data has spaces but have those spaces been truncated by HTML?
2 - Show your sort messages
3 - get rid of those capitals.
4 - SYSIN DD * is a JCL statement not a sort control statement and as such should begin //
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Mainframe - Dynamic sort card building with trailer reco

Postby Dambaattam » Thu Apr 23, 2020 12:59 pm

It worked with sort card shown below

OPTION COPY
INCLUDE COND=(1,8,CH,EQ,C'XXXXXXXX')
OUTFIL REMOVECC,
HEADER1=('SORT FIELDS=(57,8,ZD,D)',/,
'   INCLUDE COND=((57,8,ZD,GT,',9,8,C'),OR,'),
Build=(C'       (57,8,ZD,EQ,',9,8,C',AND,65,6,ZD,GT,',17,6,C'))',80:x),
TRAILER1=(C' OUTFIL,REMOVECC,',/,
''TRAILER1=(C''TRL'',DATE=(4MD/),TIME)',80:X))



Output obtained

SORT FIELDS(57,8,ZD,D)
INCLUDE COND=((57,8,ZD,GT,20200421), OR,
(57,8,ZD,EQ,20200421,AND,65,6,ZD,GT,101223))
OUTFIL REMOVECC,
TRAILER1=('TRL',DATE=(4MD/),TIME)

Coded for you DO IT YOURSELF IN FUTURE
Dambaattam
 
Posts: 7
Joined: Thu May 15, 2014 4:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Mainframe - Dynamic sort card building with trailer reco

Postby NicC » Thu Apr 23, 2020 2:08 pm

That will not work - your control statements must start in column 2, or later. As you can see from the coded statements you have them starting in column 1.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Mainframe - Dynamic sort card building with trailer reco

Postby sergeyken » Thu Apr 23, 2020 6:53 pm

Discussions with newcomers at this forum do more and more resemble a conversation between a blind person, and a deaf one... :evil:

It's getting much easier just to give a ready solution rather than trying for weeks, and for months, to give lessons for those who has no intention to learn it or to try it, at all.

//*=====================================================================
//* PROCESS DYNAMIC DATES                                              
//*=====================================================================
//SYMDATES EXEC PGM=SYNCSORT                                            
//*                                                                    
//SYSOUT   DD  SYSOUT=*                                                
//*                                                                    
//SORTIN   DD  *                                                        
XXXXXXXX 20200412101223                                                
YYYYYYYY 20200312101128                                                
ZZZZZZZZ 20200212101128                                                
//*                                                                    
//SYMBOLS@ DD  SYSOUT=*                                                
//SYMBOLS  DD  DISP=(NEW,PASS),                                        
//             DCB=(RECFM=FB,LRECL=80),                                
//             UNIT=SYSDA,SPACE=(TRK,(5,5),RLSE),                      
//             DSN=&&SYMNAMES                                          
//*                                                                    
//SYSIN    DD  *                                                        
 INCLUDE COND=(1,8,CH,EQ,C'XXXXXXXX')                                  
 SORT FIELDS=COPY,STOPAFT=1                                            
 OUTFIL FNAMES=(SYMBOLS,SYMBOLS@),NULLOFL=RC4,                          
        BUILD=(C'VALID_DATE1,C''',10,8,C'''',80:X,                      
             /,C'VALID_DATE2,C''',18,6,C'''',80:X)                      
 END                                                                    
//*                                                                    
//*                                                                    
//*=====================================================================
//SELECT   EXEC PGM=SYNCSORT,COND=(0,NE,SYMDATES)                      
//*                                                                    
//SYMNAMES DD  DISP=(OLD,DELETE),DSN=&&SYMNAMES                        
//SYSOUT   DD  SYSOUT=*                                                
//*                                                                    
//SORTIN   DD  *                                                        
AAAAAAAA                                                20200412101223  
BBBBBBBB                                                20200412101228  
CCCCCCCC                                                20200512101123  
DDDDDDDD                                                20200612101122  
TTTTTTTT                                                20200412101223  
UUUUUUUU                                                20200412101220  
VVVVVVVV                                                20200512101120  
WWWWWWWW                                                20200612101120  
//*                                                                    
//SORTOUT  DD  SYSOUT=*                                                
//*                                                                    
//SYSIN    DD  *                                                        
 INCLUDE COND=((57,8,CH,GT,VALID_DATE1),                                
            OR,(57,8,CH,EQ,VALID_DATE1,                                
            AND,65,6,CH,GT,VALID_DATE2))                                
 SORT FIELDS(57,8,CH,D)                                                
 OUTFIL REMOVECC,                                                      
        TRAILER1=('TRL ',&DATE(4MD/),X,&TIME)                          
 END                                                                    
//*                                                                    
//*                                                                    
//*=====================================================================
 

********************************* TOP OF DATA *****************************
DDDDDDDD                                                20200612101122    
WWWWWWWW                                                20200612101120    
CCCCCCCC                                                20200512101123    
VVVVVVVV                                                20200512101120    
BBBBBBBB                                                20200412101228    
TRL 2020/04/23 09:14:39                                                    
******************************** BOTTOM OF DATA ***************************
 
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post