IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT updating the trailer record count for a VB file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sureshkumar_p01

New User


Joined: 22 Feb 2007
Posts: 7
Location: bangalore

PostPosted: Mon Jan 12, 2009 5:44 pm
Reply with quote

I have a requirement where i need to eliminate certain records from the input VB file (lrecl - 9072) and write it to a new file with the trailer count updated.

The below is one which i have coded:
Code:

//S1      EXEC PGM=SORT,PARM='VLTESTI=1' 
//SYSOUT  DD SYSOUT=* 
//SORTIN  DD DSN=Input File,DISP=SHR 
//SORTOUT DD DSN=Output file,UNIT=PRIME, 
//           DISP=(MOD,KEEP,DELETE), 
//           SPACE=(23476,(1000,1000),RLSE), 
//           DCB=(RECFM=VB,LRECL=9072,BLKSIZE=23476) 
//SYSIN  DD * 
     OPTION COPY 
     OMIT COND=(14,3,CH,EQ,C'180') 
     INREC FIELDS=(1,4,5:5,9068, 
                    9073:SEQNUM,5,PD) 
     OUTREC IFTHEN=(WHEN=(5,4,CH,EQ,X'FFFFFFFF',AND, 
                          9,16,CH,EQ,C'XXXXXXXXXXXXXXXX'), 
            BUILD=(1,4,5,20,(9073,5,PD,SUB,+2),30,9032)), 
            IFTHEN=(WHEN=NONE, 
            BUILD=(1,4,5,9068)) 
/*


I got the following error message:
WER108I SORTIN : RECFM=VB ; LRECL= 9072; BLKSIZE= 23476
WER257I INREC RECORD LENGTH = 9077
WER238I POTENTIALLY INEFFICIENT USE OF INREC
WER237I OUTREC RECORD LENGTH = 9072
WER110I SORTOUT : RECFM=VB ; LRECL= 9072; BLKSIZE= 23476
WER410B 7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,207,192 BYTES USED
WER055I INSERT 0, DELETE 0
WER244A INREC - SHORT RECORD
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

PS:
I have made a search on this forum regarding this but did not find much useful info.

Thanks,
Suresh
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jan 12, 2009 5:52 pm
Reply with quote

And what does WER244A say in the manual ?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Jan 12, 2009 6:47 pm
Reply with quote

Code:
     INREC FIELDS=(1,4,5:5,9068, 
                    9073:SEQNUM,5,PD)

Suresh,

VB files should n't be padded at the end like fixed length files. By doing so, you just lose the indidual record lengths. If you want to attach some identifier to a VB file, always insert it at the beginning of the record immediately after the RDW field.
Back to top
View user's profile Send private message
sureshkumar_p01

New User


Joined: 22 Feb 2007
Posts: 7
Location: bangalore

PostPosted: Tue Jan 13, 2009 10:17 am
Reply with quote

Hi,
Thanks for ur suggestions.

I tried having the SEQNUM field in the front though not immediately after RDW. This worked and the code looks as showns below.

Code:
//S1      EXEC PGM=SORT,PARM='VLTESTI=1'                       
//SYSOUT  DD SYSOUT=*                                           
//SORTIN  DD DSN=Input File,DISP=SHR                 
//SORTOUT DD DSN=Output File,UNIT=PRIME,                       
//           DISP=(MOD,KEEP,DELETE),                           
//           SPACE=(23476,(1000,1000),RLSE),                   
//           DCB=(RECFM=VB,LRECL=9072,BLKSIZE=23476)           
//SYSIN  DD *                                                   
    OPTION COPY                                                 
    OMIT COND=(14,3,CH,EQ,C'180')                               
    INREC FIELDS=(1,4,5,20,25:SEQNUM,5,PD,30:25)               
    OUTREC IFTHEN=(WHEN=(5,4,CH,EQ,X'FFFFFFFF',AND,             
                         9,16,CH,EQ,C'XXXXXXXXXXXXXXXX'),       
           BUILD=(1,4,5,20,25:(25,5,PD,SUB,+7),PD,41:35,9026)),
           IFTHEN=(WHEN=NONE,                                   
           BUILD=(1,4,5,20,25:30))                             
/*   

The above code still has some issues with the trailer count field. The trailer count field in input file is defined as PD and is of 5 bytes in length. But now the updated trailer count occupies 8 bytes instead of 5 bytes in the output file. The value of trailer count in both the input file and output file is shown below :

Input File (HEX ON):
Code:
...h.
00283
0068C

Output File (HEX ON):
Code:
........
00000213
0000076C

Kindly help me on this.

Thanks,
Suresh

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 13, 2009 11:23 am
Reply with quote

Suresh,

Can you please explain what you're trying to achieve with the above code?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jan 13, 2009 12:04 pm
Reply with quote

Hi sureshkumar_p01,

I try to eidt your code but not sure what is that "h" in your input, is that really a part of your input? And yes please show some sample input and expected output with rules to get better replies. When you post your input and output please use BBcode.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:05 pm
Reply with quote

Suresh,

Also post the starting position and lengths of relevant fields in your input file.
Back to top
View user's profile Send private message
sureshkumar_p01

New User


Joined: 22 Feb 2007
Posts: 7
Location: bangalore

PostPosted: Tue Jan 13, 2009 12:08 pm
Reply with quote

Hi Arun,

My aim is to achieve the following things using the above code:

1. Remove all records which has 180 in position 14,3.
OMIT COND=(14,3,CH,EQ,C'180')

2. Add a SEQNUM in position 25 which will be used to update the trailer count.
INREC FIELDS=(1,4,5,20,25:SEQNUM,5,PD,30:25)

3. My file has 5 header and 5 trailer records. And i want to update the second trailer record. The reason to update this particular trailer is because this is the one which contains the count of records which has '180' in position 14,3 which we have omitted. That is why i substract 7 from the SEQNUM.
BUILD=(1,4,5,20,25:(25,5,PD,SUB,+7),PD,41:35,9026))

4. i want the trailer count to be displayed in PD format and of length 5 in the output file. But the trailer count field in the second trailer record of output file is of 8 bytes instead of 5 bytes.

Input File (HEX ON):
...h.
00283
0068C

Output file (HEX ON): Desired output File (HEX ON):
........ .....
00000213 00213
0000076C 0076C

Hope i have made myself clear.

Thanks,
Suresh
Back to top
View user's profile Send private message
sureshkumar_p01

New User


Joined: 22 Feb 2007
Posts: 7
Location: bangalore

PostPosted: Tue Jan 13, 2009 12:14 pm
Reply with quote

Hi,

Sorry there were some formatting issues in the previous post.

input file trailer count field:

...h.
00283
0068C

Output File trailer Count field:

.....
00213
0076C

Hi Anuj,

watever fields i have posted under input and output files those are jus the trailer counts. Hope i have answered ur ques.

Desired output File trailer count field:

........
00000213
0000076C
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:19 pm
Reply with quote

Are you sure that you have only '7' '180' type records?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:37 pm
Reply with quote

Quote:
3. My file has 5 header and 5 trailer records. And i want to update the second trailer record. The reason to update this particular trailer is because this is the one which contains the count of records which has '180' in position 14,3 which we have omitted. That is why i substract 7 from the SEQNUM.
BUILD=(1,4,5,20,25:(25,5,PD,SUB,+7),PD,41:35,9026))
If your input trailer is already having a count, why dont u try subtracting '7' from the existing count field in the trailer. Why would you need a SEQNUM to count it again? Let me know if I am missing something.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jan 13, 2009 4:13 pm
Reply with quote

Hello,

Suggest you to post rather complete sample input, expected output & rules along with LRECL & BLKSIZE of input output. What you are trying may be a way to achieve what you want but it's not working for you now - for us to help you it's better we know what is being expected.

You say
Quote:
My file has 5 header and 5 trailer records. And i want to update the second trailer record.
but your sample input shows only one (probably "h" was to show header). I again say, showing rather complete sample input, expected output & rules along with LRECL & BLKSIZE of input/output might fetch better answer else we'll just guesstimate.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jan 13, 2009 5:27 pm
Reply with quote

Quote:
but your sample input shows only one (probably "h" was to show header)
Anuj,

OP's sample input shows the 'HEX ON' version of the PD count field in the trailer.
Code:
000001  h
       00283
       0068C
------------
000002 
       00213
       0076C
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top