Page 1 of 2

combine CONVERT & TRAN=ALTSEQ

PostPosted: Thu Jul 16, 2009 3:47 pm
by ranga_subham
Hi,

Can we combine CONVERT & TRAN=ALTSEQ features while converting a VB to FB? Please help me with an example code.

Thanks.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Thu Jul 16, 2009 8:39 pm
by Alissa Margulies
Please provide an example of what you are trying to accomplish and then we may be able to provide you with some sample JCL.
What does your input data look like? What is your desired output? Please include the LRECL of both files as well.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Fri Jul 17, 2009 8:07 pm
by ranga_subham
Alissa, my input file (LRECL=133, RECFM=VB) has data as shown below:

----+----1----+----2----+
.00000191122.00001.
.00000183438.00001.
.00000110289.00001.


Upon viewing it with HEX ON, I find low values (X'00',X'05',X'06',X'07' etc) at many places. My requirement is to copy this VB file to FB file of 80 bytes and at the same time to convert all these low values to spaces.

Thanks.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Fri Jul 17, 2009 10:45 pm
by Alissa Margulies
Since your input data set is VB/133 and you want your output FB/80, you are obviously truncating the data. So do you want the 80 bytes to include the RDW (1,80) or include the 80 bytes after the RDW (5,80)?

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Fri Jul 17, 2009 10:49 pm
by Alissa Margulies
If you want the RDW included, then here is one way of accomplishing this task:
//SYSIN DD  *                                                     
  SORT FIELDS=COPY                                                 
  ALTSEQ CODE=(0040,0140,0240,0340,0440,0540,0640,0740,0840,0940) 
  OUTREC FIELDS=(1,80,TRAN=ALTSEQ),CONVERT                         
/*                                                                 

In SyncSort for z/OS 1.3.2, this can also be accomplished using FINDREP instead of ALTSEQ.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Fri Jul 17, 2009 11:20 pm
by ranga_subham
Thanks. I don't want the RDW because I don't know if it becomes valid data to be read ! Though the length of input file is 133 the real data appears till 67th column only. That way I don't get it truncated if copied to 80 byte output file.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Sat Jul 18, 2009 12:09 am
by Alissa Margulies
ranga_subham wrote:I don't want the RDW

Then you can simply modify the OUTREC statement as follows:
OUTREC FIELDS=(5,80,TRAN=ALTSEQ),CONVERT                             

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Sun Jul 19, 2009 9:25 pm
by ranga_subham
Thanks :D

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Tue Nov 12, 2013 5:56 pm
by jvinoth
Hi Alisa,

I have similar kind of issue.

Input file : Record format . . . : FBA
Record length . . . : 75
Input:
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 AAAAAAAAAAAA AAAAAAA AAAA AAAAAA AA AAA AAA AAA AAAAAAA AAAAAAAAAA
001250504158060000000964350364502815330950993045706120453535402433522643454445555544
00125050415806000000096435036450281533095099304570612045353540243352264345556655555B

and trying to copy to the FB file with the record length 80 using the sort.

I have used the below code to convert first two bytes of x'00' and last x'4B' to x'40'. and it changed as expected, but after that i could see
x'00' in the output file.

//SYSIN DD *
SORT FIELDS=COPY
ALTSEQ CODE=(0040,4B40)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
/*

Ouput file:
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 AAAAAAAAAAAA AAAAAAA AAAA AAAAAA AA AAA AAA AAA AAAAAAA AAAAAAAAAA
441250504158060000000964350364502815330950993045706120453535402433522643400000 001250504158060000000964350364502815330950993045706120453535402433522643000000
can you please let me know how to change this to spaces.

Re: combine CONVERT & TRAN=ALTSEQ

PostPosted: Tue Nov 12, 2013 8:34 pm
by dick scherrer
Hello,

Suggest you copy what is good from this reply into a new topic considering:
1. the output appears shorter than the input
2 use the Code tag for data that needs to be aligned (Not colors)
3. there are no x'00's in the input, so why are they in the output?