Code: |
//SORTIN DD DISP=SHR,DSN=&SYSUID..input.file //* //SORTOUT DD DISP=CATLG),DSN=&SYSUID..output.file, // RECFM=VB,LRECL=1000 //* //SYSIN DD * SORT FIELDS=(20,32,CH,A,10,8,CH,A) INCLUDE COND=((1,3,CH,EQ,C'M23',AND,10,5,CH,EQ,C'IP01P')) OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,C'M23'), BUILD=(C' ', 10,968)) /* //* |
Quote: |
M23+00300IP01P020 0001300 S21+00040GET-IP-FULL-001 M23+00029SHBGG507 00 M23+00029SHBGG507 00 |
Quote: |
ICE043A 3 INVALID DATA SET ATTRIBUTES: SORTOUT RECFM - REASON CODE IS 08 ICE751I 0 C5-I35397 C6-I35397 C7-I35397 C8-I35397 E7-I35397 |
misi01 wrote: |
I deliberately wrote the subject header as I did after googling and finding lots of examples using OUTFIL, but none using OUTREC. It could well be that I'm attacking the problem the wrong way, but here's what I'm trying to do. |
misi01 wrote: | ||
My input file is FB, 2000. My output file should be VB, 1000 (why the input file is so large compared to the output file is a matter for those who created it). I only want to select those record containing IP01P in position 10. I want the output file to contain 32 blanks and THEN contain the data from position 10 onwards. Every variation I've tried gives me error
Can anyone suggest how I should solve this. Thanks. (At the same time, I assume there's a better way of including 32 blanks at the start without coding it the way I did (something similar to Rexx's COPIES ????) |
Code: |
//SYSIN DD * INCLUDE COND=(01,3,CH,EQ,C'M23',AND, $ Only M23 and 10,5,CH,EQ,C'IP01P') $ IP01P records SORT FIELDS=(20,32,CH,A, $ Key-1 10,08,CH,A) $ Key-2 OUTREC BUILD=(32X, $ 32 Spaces 10,968) $ rest of data OUTFIL FTOV, VLTRIM=C' ' $ remove traling spaces /* |
misi01 wrote: |
I did look up the error message but got the impression that it was caused by something like the sum of the lengths of my sub-fields not being equal to the length of my variable file. |
ICE043A- Reason Code 8 wrote: |
8. Input and output data sets have mixed fixed length and variable length record formats, or mixed valid and invalid record formats. Examples: The SORTIN data set has RECFM=FB and the SORTOUT data set has RECFM=VB. The SORTIN01 data set has RECFM=VB and the SORTOUT data set has RECFM=F or RECFM=U. |
misi01 wrote: |
It's really frustrating when you "know" something can be done with dfsort/icetool, but despite all your attempts you don't get the right results. |
misi01 wrote: |
FWIW - I have a PDS library of various sort examples. As I discover new solutions,I add the example to that library. I didn't know you could include comments in the way you've done (and really like your example above with the comments for each step. That's something I'll start using) |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours