Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Hi,
I have the following file:
Code:
Organization . . . : PS
Record format . . . : FB
Record length . . . : 2623
Block size . . . . : 18361
the input records that i will need to work with ALWAYS have a customer number in pos 24 for 10. Then may OR may not have additional customer numbers starting in pos 35, for 10 BUT could go on 30 times at the maximum across the record as depicted below. There is an eye catcher, a tilde, that identifies the next customer if it exists and the last one in the record is always delimited by the pipe character. As below:
My requirement is to get all those customer numbers out of the input file and write out as rows so I can do some subsequent matching against an xref file. Output should be 10 bytes each row with the customer number from the input file as depicted above.
I could probably concatenate 30 IFTHEN's to check if the column is spaces
otherwise, write it out. Or a PARSE could do the trick, maybe. What do you guys think.
Output looks like the following for the first record depicted above.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx,
The following DFSORT/ICETOOL JCL will give you the desired results. With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to easily create larger records from smaller records, or smaller records from larger records.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Kolusu,
Awesome, thank you. We don't have the 'H' ptf's installed here yet. I am trying to get them to do that, but, for now we have only 'G;. I will tinker with this to make it happen for this part of the project. I believe all i need to do is replace RESIZE with a COPY or something close to that. Again, much appreciated and thank you.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx wrote:
Kolusu,
I believe all i need to do is replace RESIZE with a COPY or something close to that. Again, much appreciated and thank you.
Wish it was that easy. NO you cannot replace RESIZE with copy operator and still get the desired results. That something else close is multiple IFTHEN statements to check if it is a space and not write that record.
Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
Hi,
Tried the multiple IFTHEN but got the following after a quick test to get the 2nd one first.
Code:
INREC IFTHEN=(WHEN=(24,01,CH,NE,C' '),
BUILD=(24,10,20X,1,10))
IFTHEN=(WHEN=(35,01,CH,NE,C' '),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
BUILD=(35,10,20X,1,10))
Once i took out ENDBEFR=(C' ') I got the following, which, I can work with. With the initial PARSE you gave me I was getting the first vendor number then about 25 blanks then the second and so on. The output lrecl was set to 240 and I would only get the first 6 or so. Dunno why but the output now looks like:
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
madmartinsonxx,
I am sorry what was your question? Are you saying that you are not getting the desired results? If so I would have to see the complete control cards you used.