|
View previous topic :: View next topic
|
| Author |
Message |
madmartinsonxx
New User

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:
| Code: |
P50050 |000000|Z003|YY1250 ~YY7625 ~YY8021 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - 1 RECORD(S) NOT SELECTED
P50051 |000000|Z003|YY0740 ~YY1010 ~YY1058 ~YY1250 ~YY4000 ~YY
- - - - - - - - - - - - - - - - - - - - - - - - - - - 1 RECORD(S) NOT SELECTED
P50052 |000000|Z003|C12010 ~C12011 ~C12012 ~C12013 ~C12014 ~C1
- - - - - - - - - - - - - - - - - - - - - - - - - - - 1 RECORD(S) NOT SELECTED
P50054 |000000|Z003|YY0740 ~YY1010 ~YY1058 ~YY1250 ~YY8021 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - 1 RECORD(S) NOT SELECTED
P50062 |000000|Z003|YY0740 ~YY1010 ~YY1058 ~YY1250 ~YY8021 |
- - - - - - - - - - - - - - - - - - - - - - - - - 50718 RECORD(S) NOT SELECTED
002139 |000000|Z003|ED3480 ~WW8707 |
- - - - - - - - - - - - - - - - - - - - - - - - - - - 4 RECORD(S) NOT SELECTED
|
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.
| Code: |
YY1250
YY7625
YY8021
|
thanks. |
|
| Back to top |
|
 |
Skolusu
Senior Member
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.
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=your input FB 2623 file,DISP=SHR
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(08) USING(CTL1)
//CTL1CNTL DD *
OMIT COND=(1,1,CH,EQ,C'-')
INREC PARSE=(%01=(ABSPOS=24,ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%02=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%03=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%04=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%05=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%06=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%07=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%08=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%09=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%10=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%11=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%12=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%13=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%14=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%15=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%16=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%17=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%18=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%19=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%20=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%21=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%22=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%23=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%24=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%25=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%26=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%27=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%28=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%29=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8),
%30=(ENDBEFR=C'~',ENDBEFR=C' ',FIXLEN=8)),
BUILD=(%01,%02,%03,%04,%05,%06,%07,%08,%09,%10,
%11,%12,%13,%14,%15,%16,%17,%18,%19,%20,
%21,%22,%23,%24,%25,%26,%27,%28,%29,%30)
OUTFIL OMIT=(1,1,SS,EQ,C' ,|')
//* |
For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242 |
|
| Back to top |
|
 |
madmartinsonxx
New User

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. |
|
| Back to top |
|
 |
Skolusu
Senior Member
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. |
|
| Back to top |
|
 |
madmartinsonxx
New User

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))
|
going to try hit=next now. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It looks like you are missing a comma immediately before the problem/flagged IFTHEN. . . |
|
| Back to top |
|
 |
madmartinsonxx
New User

Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
SKolusu,
I finally had some time to revisit this.
| Code: |
INREC PARSE=(%01=(ABSPOS=24,ENDBEFR=C'~',FIXLEN=8),
%02=(ENDBEFR=C'~',FIXLEN=8),
%03=(ENDBEFR=C'~',FIXLEN=8),
|
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:
| Code: |
YY0740 YY1010 YY1058 YY1250 YY1581 YY2619 YY2629 YY3041 YY5463 YY7625 YY0740 YY1010 YY1058 YY1250 YY1581 YY2619 YY2629 YY3041 YY5463 YY7625
YY0740 YY1010 YY1058 YY1250 YY1581 YY2619 YY2629 YY3041 YY5463 YY7625
YY0740 YY1058 YY1250 YY1581 YY2619 YY2629 YY7625 YY8021
YY0740 YY1010 YY1058 YY1250 YY1581 YY2619 YY2629 YY3041 YY5463 YY7625
YY1010 YY1058 YY1250 YY1581 YY3085 YY8021
YY0740 YY1058 YY1250 YY1581 YY2619 YY2629 YY7625 YY8021
YY1058 YY1250 YY1581 YY7625 YY8021
YY1058 YY1250 YY1581 YY3085 YY8021
|
and again, i can work with that.
Thanks I thought I should post this in case somebody else runs into the same type of thing with their data.
[/code] |
|
| Back to top |
|
 |
Skolusu
Senior Member
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. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|