MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FB to VB using OUTREC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Fri Oct 21, 2016 10:41 am    Post subject: FB to VB using OUTREC Reply with quote

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 ????)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Fri Oct 21, 2016 11:08 am    Post subject: Reply with quote

This will solve your 32 blank problem

32Z, 32 ZEROES
32X, 32 SPACES
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Fri Oct 21, 2016 12:51 pm    Post subject: Reply with quote

Thanks for that nascar9
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Fri Oct 21, 2016 9:12 pm    Post subject: Re: FB to VB using OUTREC Reply with quote

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

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Sat Oct 22, 2016 12:10 am    Post subject: As usual, thanks Kolusu Reply with quote

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)
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Oct 24, 2016 12:38 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 616
Topics: 171
Location: Stockholm, Sweden

PostPosted: Mon Oct 24, 2016 3:03 am    Post subject: Reply with quote

Thanks Kolusu - worked a treat
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Mon Oct 24, 2016 11:39 am    Post subject: Re: As usual, thanks Kolusu Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group