Hi,
I'm formating an SMF input file.
Somewhere in the input file ther is a variable length field which is a dataset name.
I know how to find where the dataset name is starting, I know where to find the dataset name length, but I don't see how to use the dataset name length in the outrec statement (which can be different on each record).
Here is a snippet of my code, it seems to work, but the datset name output len is always the same (because of the symbols generation step...)
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
For your information, you are using the OUTREC parameter of OUTFIL, not the OUTREC statement. It would be less confusing if you used BUILD on OUTFIL instead of OUTREC on OUTFIL. And BUILD on the OUTREC statement, and on INREC. See here.
My problem is that symbol SMFTLTFI has a value obtained in symbol generation in the first step, but this value can change on every input record; this value is at position 49 ans is two binary digits, I tried to parse with INREC but unsuccessfully...
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, that is what I mean. I'll change the title of the topic to reduce confusion.
I'm trying to think of a way of avoiding 40+ IFTHEN=(WHEN=(logical-expression statements, which I assume you'd like to avoid if possible.
So what I want to know is what data immediately follows the DSN on the record. You're not interested in the rest of the record, so we are free to destroy it, if in doing that it assists your task.
For instance, if the DSN is always followed by X'00' (or some other constant value) you could FINDREP that to a bunch of space (like 44 of them) and then just use the full-length DSN from the start point that you already know.
Broadly, if the byte following the end of the DSN in the record is not valid for appearing in a DSN, then FINDREP will give you a solution. So... what follows the last character of the DSN? I assume you have the manual-page well-thumbed by now, so I'm not going to look myself :-)
Yes, that is what I mean. I'll change the title of the topic to reduce confusion.
No problem, that's right
I'm trying to think of a way of avoiding 40+ IFTHEN=(WHEN=(logical-expression statements, which I assume you'd like to avoid if possible.
Oh yes
So what I want to know is what data immediately follows the DSN on the record. You're not interested in the rest of the record, so we are free to destroy it, if in doing that it assists your task.
I don't know this, I'm interested in the rest of the record...
For instance, if the DSN is always followed by X'00' (or some other constant value) you could FINDREP that to a bunch of space (like 44 of them) and then just use the full-length DSN from the start point that you already know.
I do not have a delimiter
Broadly, if the byte following the end of the DSN in the record is not valid for appearing in a DSN, then FINDREP will give you a solution. So... what follows the last character of the DSN? I assume you have the manual-page well-thumbed by now, so I'm not going to look myself :-)
Of course I have the manuals, but I didn't find the trick, this is why I went there...I'll do it with REXX...
This will find a byte which matches the IN=( starting from STARTPOS, and then, once only (DO=1), change it to 44 spaces.
You'll need to amend the list above, since it has everything except a "#". So you need to remove everything that is valid in a DSN (letters, numbers, dots, and some other stuff).
This will work only if the byte immediately following the DSN is not valid to appear in a DSN, and if you don't need that byte for something else.
If you need data further up the record, which you didn't show being used, you just have to displace everything by 43 beyond the DSN.
You won't find it in a manual, because I made it up especially for you, between starting to write the previous post (where I thought you may get lucky with a constant value) and getting to the end of it, by which point I realised a known value wasn't needed :-)