Page 1 of 1

Adding a SUFFIX to a field

PostPosted: Wed Feb 23, 2011 9:52 pm
by RajeshT
Hi,

I'm trying to add a SUFFIX to a particular field. PARTNER NAME is the field starts at 75 position with a length of 35 characters. I wanted to add a SUFFIX at the end of PARTNER name. Though the LENGTH of the field is 35, am not sure about the LENGTH of the value it is going to be at this particular position.

Example Input :-
ACOSTA
KENDERLFLOREL
PEPSICO

Expected Output :-
ACOSTA(5010)
KENDERLFLOREL(5010)
PEPSICO(5010)

Here is what i have used initially, but then i have realized that i need it to be added as a SUFFIX, but not a PREFIX.
//SYSIN DD *
SORT FIELDS=COPY
IFTHEN=(WHEN=(44,2,CH,EQ,C'NA'),
OVERLAY=(81:75,35,75:C'(5010)',374:&DATENS=(MDY),
380:&TIMENS=(24),386:C'00VUP'))
/*

Please suggest.

Re: Adding a SUFFIX to a field

PostPosted: Fri Feb 25, 2011 5:05 am
by Thampy
Rajesh,
You can modify your OVERLAY to include SQZ subparameter as given below. You can add the overlay fields accordingly.
IFTHEN=(WHEN=(44,2,CH,EQ,C'NA'),
OVERLAY=(75:75,35,SQZ=(SHIFT=LEFT,TRAIL=C'(5010)'))

Re: Adding a SUFFIX to a field

PostPosted: Tue Mar 01, 2011 6:44 pm
by RajeshT
Hi Thampy,

Thank you for the response and it worked for me perfectly. Have a good day.

Rajesh.

Re: Adding a SUFFIX to a field

PostPosted: Tue Mar 01, 2011 7:35 pm
by ranga_subham
this is cool :o I like it. :D

two suggestions:

1). INREC statement is missing
2). Another ')' is required in the end -OVERLAY=(75:75,35,SQZ=(SHIFT=LEFT,TRAIL=C'(5010)'))


Thanks.

Re: Adding a SUFFIX to a field

PostPosted: Wed Mar 02, 2011 2:15 am
by dick scherrer
Hello,

If the posted soltion works perfectly, why are any suggestions needed . . . :?

d