Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SYNCSORT updating the trailer record count for a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT updating the trailer record count for a VB file
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jan 12, 2009 5:52 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Mon Jan 12, 2009 6:47 pm    Post subject:
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    Post subject: Reply to: SYNCSORT updating the trailer record count for a V
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: 2285
Location: @my desk

PostPosted: Tue Jan 13, 2009 11:23 am    Post subject:
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

Senior Member


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

PostPosted: Tue Jan 13, 2009 12:04 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:05 pm    Post subject:
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    Post subject: Reply to: SYNCSORT updating the trailer record count for a V
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    Post subject: Reply to: SYNCSORT updating the trailer record count for a V
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: 2285
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:19 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Tue Jan 13, 2009 12:37 pm    Post subject:
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

Senior Member


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

PostPosted: Tue Jan 13, 2009 4:13 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Tue Jan 13, 2009 5:27 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us