Otherwise there is a chance that X'0A' is one of RDW bytes, and/or your %01 would start with the RDW field...
P.S.
The explanation from the manual is as clear as the bell:
Quote:
WER235A [ddname] {INREC,OUTREC,REFORMAT} RDW NOT INCLUDED
EXPLANATION:
The ddname will be SORTOUT, SORTOFxx, SORTOFx or the ddname provided by an OUTFIL FNAMES parameter.
Four bytes must be provided for the RDW of the variable-length output record in the FIELDS parameter of the INREC, OUTREC, OUTFIL, OUTREC, or REFORMAT specification. These bytes must appear at the beginning of the record and must not be edited. For REFORMAT, the RDW must be specified as coming from a variable-length join input
data set.
However, not sure to be on the right track .. my input vb file got 146 x"0A', so the purpose is to have this splitted in 146 records, however from job execution I get the follow:
Code:
OUTFIL WAS USED FOR SORTOUT
FILESIZE 47,729 BYTES
RCD IN 2, OUT 2
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
You need to review ABSPOS & FIXLEN
You probably only want ABSPOS for first parsed field.
FIXLEN should be more in line with the max number of bytes expect between parses within the whole variable length record (are 146 occurrences typical or is it more likely to be 1 or 10 or 200 ...)
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
Assumed the DSN comes per FTP, check the options to transfer it in the correct format. You can specify line terminators and also conversion options for UTF.
Question: is there a way to include wilde card to apply PARSE and BUILD to all the records and avoid %nn ?
In the ISPF editor it took me about 13 seconds to create as many lines in BUILD as needed.
Just a test JCL, to demonstrate the method of clean splitting.
********************************* TOP OF DATA ******
(00014,00000):1111111111
(00009,00000):Name1
(00012,00000):Address1
(00010,00000):Phone1
(00014,00000):2222222222
(00009,00000):Name2
(00009,00000):Name3
(00010,00000):Phone2
(00014,00000):3333333333
(00009,00000):Name4
(00012,00000):Address2
(00012,00000):Address3
(00010,00000):Phone3
(00010,00000):Phone4
******************************** BOTTOM OF DATA ****
.. in my case the challenge is that I do not have control on number of records in in input, so if I use limited %nn risk to miss out valid information
One way to do it:
1) split records to any limited amount of parts, let’s say up to 200 parts. The last parts of each record may include extra unprocessed bytes X’0A’;
2) such records need to be separated, and that intermediate subset can be processed once again, using exactly the same procedure.
If each stage can split up to 200 substrings, the procedure can be repeated until no more records with X’0A’ byte left.
1. REPEAT command ... can I please confim that this repeat the PARSING within the same line ... let"s say I set to 20, then will repeat the pasing within same line 20 times ?
2. The FIXLEN, how is this correlate to LREC ? in my case I have an LRECL=32756 but FIXLEN=32752. what would be the risk of mismatch in this case ? is there a VARLEN for VB files ?
Joined: 15 Aug 2015 Posts: 1305 Location: Bamberg, Germany
roberto2023 wrote:
1. REPEAT command ... can I please confirm that this repeat the PARSING within the same line ... let's say I set to 20, then will repeat the parsing within same line 20 times ?
2. The FIXLEN, how is this correlate to LREC ? in my case I have an LRECL=32756 but FIXLEN=32752. what would be the risk of mismatch in this case ? is there a VARLEN for VB files ?
FIXLEN must define your maximum possible substring length (between any pair of X'0A').
For the last used %nnn its FIXLEN must be long enough to fit the rest of the string yet unparsed; to be on safe side it makes sense to make the last FIXLEN be equal to your LRECL.
P.S.
By default any %nnn substring shorter than its FIXLEN is extended to the right with regular blanks. That's why making FIXLEN longer than needed would require more resources when running.
// thank you for helping, unfortunately given the matter that I have no control on the input file the matter that I have to define limited REPEAT and limited BUILD my be a constrain for me to use this feature ... I wonder if I should consider EASYTRIEVE