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 

Pad a constant in VB

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


Joined: 23 Sep 2003
Posts: 5
Topics: 2

PostPosted: Wed Oct 22, 2003 11:35 am    Post subject: Pad a constant in VB Reply with quote

Hi,

I want to pad a constant 'D' at the begining of the records in a file. The file is VB and is having the record length as 9279. The SYNCTOOL is used.

The sort card created is:
Quote:
//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:C'D',6:5,9278)
/*

I am getting "OUTREC - SHORT RECORD" Error.
The record on which the sorting is made is having a length of 805.

The record length will differ for each record as it is VB. Can any one suggest the method to handle this condition.

Thanks,
Naveen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Oct 22, 2003 12:21 pm    Post subject: Reply with quote

Naveen,

For Vb records you don't have to specify the entire length. so change your sort card to the following.
Code:

 OUTREC FIELDS=(1:1,4,      $ RDW
               5:C'D',     $ CONSTANT VALUE
               6:5)        $ REST OF THE RECORD


Since you are using COPY statement in toolin you don't have to code SORT FIELDS=COPY in your
control cards.

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kingofbeasts
Beginner


Joined: 23 Sep 2003
Posts: 5
Topics: 2

PostPosted: Thu Oct 23, 2003 3:02 am    Post subject: Reply with quote

Kolusu,

Thanks for the reply.

I need to retain the length of the record. When a constant is added, the length of the record is increased. Please suggest
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Oct 23, 2003 5:01 am    Post subject: Reply with quote

Naveen,

Just hard code the Lrecl on the sortout dataset , so that the last byte gets truncated.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kingofbeasts
Beginner


Joined: 23 Sep 2003
Posts: 5
Topics: 2

PostPosted: Fri Oct 24, 2003 5:17 am    Post subject: Reply with quote

Kolusu,

I am getting "OUTPUT LRECL REQUIRES PADDING OR TRUNCATION" error message.

The sort card used is

Quote:

//TOOLIN DD *
COPY FROM(IN) TO(OUT) USING(HHHH)
COPY FROM(IN) TO(OUT) USING(DDDD)
COPY FROM(IN) TO(OUT) USING(TTTT)
//HHHHCNTL DD *
OPTION STOPAFT=1
//DDDDCNTL DD *
OPTION SKIPREC=1
OMIT COND=(5,7,CH,EQ,C'TRAILER')
OUTREC FIELDS=(1:1,4,5:C'D',6:5)
//TTTTCNTL DD *
OPTION SKIPREC=1
INCLUDE COND=(5,7,CH,EQ,C'TRAILER')
/*



I am removing the header and trailer before padding a constant to each detail record.

Please suggest, if any wrong in the sort card.

Thanks,
Naveen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Oct 24, 2003 8:32 am    Post subject: Reply with quote

Naveen,

Are you getting a informational message(WERNNNI) or abend-error message(WERNNNA) ?

The informational message can be ignored. If you are indeed getting a abend-error message then can you please post the sysout which contains the messages.Post the entire sysout message.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kingofbeasts
Beginner


Joined: 23 Sep 2003
Posts: 5
Topics: 2

PostPosted: Tue Nov 11, 2003 5:44 am    Post subject: Reply with quote

Kolusu,

I was on vacation for some day.

Here is the sysout of the SYNCTOOL

Quote:

DDDDCNTL :
OPTION SKIPREC=1
OMIT COND=(5,7,CH,EQ,C'TRAILER')
OUTREC FIELDS=(1:1,4,5:C'D',6:5)
PARMLIST :
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=IN,SORTOUT=OUT,SORTDD=DDDD,COPY
WER901I **WARNING** SYNCSORT PRODUCT WILL EXPIRE IN 29 DAYS
WER428I CALLER-PROVIDED IDENTIFIER IS "0002"
WER164B 1,028K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,004K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I IN : RECFM=VB ; LRECL= 9283; BLKSIZE= 27998
WER237I OUTREC RECORD LENGTH = 9284
WER110I OUT : RECFM=VB ; LRECL= 9283; BLKSIZE= 27998
WER462I OUTPUT LRECL REQUIRES PADDING OR TRUNCATION
WER247A OUT HAS INCOMPATIBLE LRECL
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Naveen
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Nov 11, 2003 8:51 am    Post subject: Reply with quote

Naveen,

Try addding the parm VLTRIM.The VLTRIM parameter defines a byte to be deleted from the end of a variable-length record. All prior occurrences of this byte will also be deleted until a byte that is not equal to the trim byte is found. The resulting records are decreased in record length.

Code:

 OUTFIL VLTRIM=C' ',OUTREC FIELDS=(1:1,4,5:C'D',6:5)


Hope this helps...

cheers

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