VBA file and Syncsort and using SEQNUM to get desired output

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
Daya Shetty
New Member
Posts: 8
Joined: Sun Mar 30, 2014 9:43 pm

VBA file and Syncsort and using SEQNUM to get desired output

Post by Daya Shetty »

I have a file like this:

Code: Select all

BETA 92 V4R5    - JOB CONTROL REPORT UTILITY                                    
PROGRAM B92BFJBR (NONE    ) STARTED.                                            
REPORT                                                                          
  SDATE(22.09.2014)                                                             
  STIME(10:00:00)                                                               
  PDATE(22.09.2014)                                                             
  PTIME(11:30:00)                                                               
  JOBNAME(S%BB*)                                                                
  QUEUE(ERROR)                                                                  
BETA 92 V4R5    - JOB CONTROL REPORT UTILITY                                    
JOBNAME   JES-ID   SUB DATE  SUB TIME  STA DATE  STA TIME  END DATE  END TIME   
-------- -------- ---------- -------- ---------- -------- ---------- -------- --
SDBB57L  JOB57145 22.09.2014 10:01:44 22.09.2014 10:01:45 22.09.2014 10:02:25 I 
================================================================================
SDBBSIG1 JOB57230 22.09.2014 10:02:12 22.09.2014 10:02:16 22.09.2014 10:02:18 I 
================================================================================
SDBBSIG  JOB57411 22.09.2014 10:03:05 22.09.2014 10:03:09 22.09.2014 10:03:10 I 
================================================================================
SDBBM585 JOB57426 22.09.2014 10:03:13 22.09.2014 10:03:14 22.09.2014 10:03:15 I 
================================================================================
SDBBM584 JOB57427 22.09.2014 10:03:13 22.09.2014 10:03:14 22.09.2014 10:03:15 I 
================================================================================
SDBBM583 JOB57428 22.09.2014 10:03:13 22.09.2014 10:03:14 22.09.2014 10:03:15 I 
================================================================================
SDBBM582 JOB57429 22.09.2014 10:03:13 22.09.2014 10:03:14 22.09.2014 10:03:15 I 
================================================================================
SDBB703S JOB59658 22.09.2014 10:42:37 22.09.2014 11:17:18 22.09.2014 11:17:18 I 
BETA 92 V4R5    - JOB CONTROL REPORT UTILITY                                    
JOBNAME   JES-ID   SUB DATE  SUB TIME  STA DATE  STA TIME  END DATE  END TIME   
-------- -------- ---------- -------- ---------- -------- ---------- -------- --
SDBBM324 JOB61443 22.09.2014 11:26:38 22.09.2014 11:27:40 22.09.2014 11:27:43 I 
================================================================================
SDBB57L  JOB61703 22.09.2014 11:28:36 22.09.2014 11:28:51 22.09.2014 11:29:53 I 
================================================================================
SDBB9XX  JOB61963 22.09.2014 11:29:57 22.09.2014 11:32:21 22.09.2014 11:32:35 I 
================================================================================
SDBBSIG1 JOB61964 22.09.2014 11:29:57 22.09.2014 11:32:20 22.09.2014 11:32:28 I 
================================================================================
30 JOB(S) MATCHED SELECTION CRITERIA.                                           
PROGRAM B92BFJBR (NONE    ) ENDED WITH RC(0).                                   
Need an output like this:

Code: Select all

********************************* Top of Data **********************************
JOBNAME   JES-ID   SUB DATE  SUB TIME  STA DATE  STA TIME  END DATE  END TIME   
-------- -------- ---------- -------- ---------- -------- ---------- -------- --
SDBB6806 JOB59656 22.09.2014 10:42:36 22.09.2014 11:16:51 22.09.2014 11:17:12 I 
================================================================================
SDBB703S JOB59658 22.09.2014 10:42:37 22.09.2014 11:17:18 22.09.2014 11:17:18 I 
******************************** Bottom of Data ********************************
Used this SORT card:

Code: Select all

//SYSIN    DD  *                                           
  OPTION COPY                                              
  INREC IFTHEN=(WHEN=(6,1,CH,EQ,C'S',AND,95,2,CH,NE,C'CC'),
               OVERLAY=(5:C'01',7:5,133)),                 
        IFTHEN=(WHEN=(6,8,CH,EQ,C'--------'),              
               OVERLAY=(5:SEQNUM,2,ZD,7:5,133)),           
        IFTHEN=(WHEN=(6,3,CH,EQ,C'JOB'),                   
               OVERLAY=(5:SEQNUM,2,ZD,7:5,133))            
  OUTFIL INCLUDE=(5,2,CH,EQ,C'01')                         
  OUTREC FIELDS=(1,4,5:7)                                  
But the output is coming like:

Code: Select all

********************************* Top of Data **********************************
1OBNAME   JES-ID   SUB DATE  SUB TIME  STA DATE  STA TIME  END DATE  END TIME   
1------- -------- ---------- -------- ---------- -------- ---------- -------- --
1DBB6806 JOB59656 22.09.2014 10:42:36 22.09.2014 11:16:51 22.09.2014 11:17:12 I 
1DBB703S JOB59658 22.09.2014 10:42:37 22.09.2014 11:17:18 22.09.2014 11:17:18 I 
******************************** Bottom of Data ********************************
Can someone please guide.

LRECL of inpunt=137, RECFM=VBA.
zprogrammer
Global Moderator
Global Moderator
Posts: 588
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by zprogrammer »

Try to remove

Code: Select all

  OUTFIL INCLUDE=(5,2,CH,EQ,C'01')                         
  OUTREC FIELDS=(1,4,5:7) 
and See what is there in output
zprogrammer
Daya Shetty
New Member
Posts: 8
Joined: Sun Mar 30, 2014 9:43 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by Daya Shetty »

It shows the added sequence number at position 5.

My basic question is how do we add the SEQNUM in a VB file so that we don't loose the length of the individual records?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by William Collins »

Code: Select all

IFTHEN=(WHEN=INIT,
         BUILD=(1,4,2X,5)),
Then you can use your OVERLAY of the sequence numbers without having to do anything else.
Daya Shetty
New Member
Posts: 8
Joined: Sun Mar 30, 2014 9:43 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by Daya Shetty »

And then remove the sequence number later...
Daya Shetty
New Member
Posts: 8
Joined: Sun Mar 30, 2014 9:43 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by Daya Shetty »

Sorry I did not see your response William.

WHEN=INIT is something I'm trying to learn. When we use it, does it apply to every record in the file or just the firt one (INIT?)?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by William Collins »

WHEN=INIT applies to every record.

You can have multiple WHEN=INITs. It allows things to be done unconditionally, rather than conditionally.

To take the sequence number off, use BUILD=(1,4,7) which says "I'm going to make a new current record from the existing current record. It consists of the RDW and the data from position seven up to the end of the record". Since you ignore the field that you added, it is as though it never existed.
Daya Shetty
New Member
Posts: 8
Joined: Sun Mar 30, 2014 9:43 pm

Re: VBA file and Syncsort and using SEQNUM to get desired ou

Post by Daya Shetty »

Thanks William. It's a very nice explanation.

I'll use that and see if it works for me.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”