FB to VB using OUTREC
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: FB to VB using OUTREC Author: misi01Location: Stockholm, Sweden PostPosted: Fri Oct 21, 2016 10:41 am
    —
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.
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).
This is my JCL
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))                             
/*                                                             
//*

Basically, the input file contains records similar to the following:-
Quote:

M23+00300IP01P020 0001300
S21+00040GET-IP-FULL-001
M23+00029SHBGG507 00
M23+00029SHBGG507 00

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
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


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 ????)

#2:  Author: NASCAR9Location: California PostPosted: Fri Oct 21, 2016 11:08 am
    —
This will solve your 32 blank problem

32Z, 32 ZEROES
32X, 32 SPACES

#3:  Author: misi01Location: Stockholm, Sweden PostPosted: Fri Oct 21, 2016 12:51 pm
    —
Thanks for that nascar9

#4: Re: FB to VB using OUTREC Author: kolusuLocation: San Jose PostPosted: Fri Oct 21, 2016 9:12 pm
    —
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,

A quick clarification here. If you wanted to convert an FB file to VB file using OUTREC, then you need to use the Parm CONVERT. However DFSORT supports the CONVERT parameter on the OUTFIL statement, but not on the OUTREC statement. If you specify the CONVERT parameter on DFSORT's OUTREC statement, you'll get an error message instructing you to use CONVERT (or VTOF) on the OUTFIL statement instead of on the OUTREC statement.

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
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


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 ????)


Nascar9 has shown you how you to code "n" spaces.

If you looked up ICE043A message in DFSORT message and codes manual for reason code 8 you would have noticed that you have mismatch of RECFM's.

As for solving the problem, Your Include statement is already selecting M23 records and IP01P records and there is no reason as to why you need to check again for M23 value.

Use the following control cards (UNTESTED)

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
/*

#5: As usual, thanks Kolusu Author: misi01Location: Stockholm, Sweden PostPosted: Sat Oct 22, 2016 12:10 am
    —
I'll try that first thing on Monday morning.

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. Then I got sidetracked by various examples that showed the first part of the build being 1,4 (for the RDW).

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.

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)

#6:  Author: William Collins PostPosted: Mon Oct 24, 2016 12:38 am
    —
Have I never mentioned SORT Symbols? Smile

Not only do they give you the commentary, but you get to use them - define in one place, use as in as many places as you need, with no only one place to typo/maintain (the definition).

#7:  Author: misi01Location: Stockholm, Sweden PostPosted: Mon Oct 24, 2016 3:03 am
    —
Thanks Kolusu - worked a treat

#8: Re: As usual, thanks Kolusu Author: kolusuLocation: San Jose PostPosted: Mon Oct 24, 2016 11:39 am
    —
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.


Misi01,

I am not sure where you got that information but "ICE043A 3 INVALID DATA SET ATTRIBUTES: SORTOUT RECFM - REASON CODE IS 08 is explained as follows.

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.


And here is the link to that

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cm60/2.2.42?


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.


Well most of the time you seem to fixated on certain thing and then scour the internet for that. As I mentioned earlier, I would suggest that you start looking first into "DFSORT Application programming Guide" which would answer most of your queries.

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)


well most of the solutions I post have some level of comments and also I code the statements in the order they are processed. Comments are useful in the long run and helps in maintaining the code.

Here is a pictorial representation of DFSORT processing.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/1.5.4



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group