View previous topic :: View next topic
|
Author |
Message |
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Hi All,
I have got a file whose LRECL is 2133. One of the in btw field which is X(15) starting at position 2104 and ends at 2118, needs to be expanded to X(19), with expanded 4 bytes with zeros. So the new start and end position of the field would be from 2104 to 2122.
Please suggest a sort card to expand the field, so that the Lrecl of the file will be changed from 2133 to 2137. I suppose OUTREC would serve the purpose.
Thanks in advance
Ajay. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
OUTREC FIELDS=(1,2118,4Z,2119,14) |
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Hi Sambhoji,
Thanks a lot for the quick reply.
Rather than populating zeros, is it possible to put in spaces in those 4 bytes?.
Thanks
Ajay. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
Rather than populating zeros, is it possible to put in spaces in those 4 bytes?. |
Yes. You can put '4X' to put 4 spaces. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Rather than populating zeros, is it possible to put in spaces in those 4 bytes?.
|
Yes it is possible by solution suggested by Arun.
Also you can do as
OUTREC FIELDS=(1,2118,2123:2119,14)
characters 2119 to 2122 will get automatically filled with spaces |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Sambhaji wrote: |
.. will get automatically filled with spaces |
Is not it site specific ? I recall that with DFSORT it's X'40' but how about SyncSort ? And do they keep changing such defaults across shops or are they same always ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If things are actually specified, there is no need to wonder about product/site defaults.
Many organizations have standards that require all positions to be specifically filled so than anyone looking at the control statements can have no doubt as to what the output contains. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
HI Dick,
I didn't wonder it's a curiosity rather.. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Is not it site specific ? |
I dont think so because at
Here
I read below
Quote: |
Specifying c:X as your last field is an easy way to increase the record length of your output records to c bytes. For example, if you want to create 80-byte output records containing the first 30 bytes of your input records padded with blanks, you can use this OUTREC statement:
OUTREC BUILD=(1,30,80:X)
DFSORT automatically sets LRECL=80 for the SORTOUT data set if you do not override the LRECL. |
|
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
HI All,
Thanks for your replies.
Now the issue is with a file which is VB(variable block).
The size of a file is shown a 2123 for lrecl. but when u go inside the file you can see the file ending at 2119.
If u consider it as a FB the field to be expanded ends at 2108, and I have to put 4 spaces after that and then the remaining fields should come.
I wanted the VB file to have lrecl as 2127.
I followed the below method which does not seems to be working:
1.
sort fields=copy
outrec=(1,2108,4X,2109,11)
2.
sort fields=copy
outrec=(1,2112,4X,2113,11)
All these not seems to be working. can any one help me pls.
Thanks
Ajay/C |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
All these not seems to be working. can any one help me pls. |
Posting that it doesn't work provids nothing for any here to use to help you. You need to clarify what "not working" means for each case.
It may help if you view the output fles online and copy/paste some of the data (beginning with pos 1). When you copy/paste the data, use the "Code" tag near the top of the reply panel. Use Preview to verify that your post appears the way you want, then Submit.
When you work with variable length data, you must account for the 4 positons used by the rdw. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Now the issue is with a file which is VB(variable block).
The size of a file is shown a 2123 for lrecl. but when u go inside the file you can see the file ending at 2119.
If u consider it as a FB the field to be expanded ends at 2108, and I have to put 4 spaces after that and then the remaining fields should come.
I wanted the VB file to have lrecl as 2127. |
Ajay,
Here's a DFSORT job that will do what you described:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/2123)
//SORTOUT DD DSN=... output file (VB/2127)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,2108,4X,2109)
/*
|
Note that 2109 means copy the bytes from position 2109 to the end of the record. That's how you handle variable length records. |
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Hi Dick,
Sorry to make you confused.
Actually I have a VB file which is of Lrecl=2123
which needs to be expanded to 2127 after adding 4 byte spaces in between the file.
The field which needs an expansion ends at 2108, so I want 4 spaces after this field and then the remaining fields should appear as is in outout file.
Please let me know whether this is possible.
Thanks
Ajay. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Frank,
what happens when you encounter short records ?
ie.
Code: |
ICE218A 6 99 BYTE VARIABLE RECORD IS SHORTER THAN 100 BYTE MINIMUM FOR
|
I tried this on a VB file with an LRECL of 133
Code: |
OUTREC BUILD=(1,100,4X,101)
|
Gerry |
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Hi Frank,
It does not seems to be working.
Thanks
Ajay |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
maybe this
Code: |
OUTREC BUILD=(1,2108,4X,2109)
|
can only apply to records GE 2113 bytes long.
Gerry |
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Can any one explain what is RDW related to VB file.? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
HI All,
Any one have idea about my previous query?
How to sort a VB file with Outrec?
Thanks
AJAY. |
|
Back to top |
|
|
ajay_udl
New User
Joined: 10 Oct 2006 Posts: 29
|
|
|
|
Hi all,
input file lrecl=2123 (VB)
Output file required lrecl=2127 (VB)
starting from 2113 to 2116 require spaces.
When I'm running the job with below sysin:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5,2112,2117:2113,11)
/*
I'm getting an abend : outrec RDW not included. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Plewase do not double-post the same question. The other topic has been removed.
You are getting slow turnaround because you are not posting the necessary info for the people who are avaiable. When an attempt is not successful, you need to post the jcl, the control statements, and the informational messages including their message id. If you get undesirable output, you need to post some of the "bad" output. When you post these details, use copy/paste and Preview. When you are satisfied that your post is as you want, Submit. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Ajay,
The below card should work for you. If not, you need to post some of your input data with file-positions.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Input VB,LRECL=2123
//SORTOUT DD DSN=Output VB,LRECL=2127
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,2112,4X,2113) |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
what happens when you encounter short records ? |
The OP said he wanted to insert 4 spaces in the middle of the record. To me that implies that there aren't any short records up to that point. If there are, then what does it mean to insert 4 spaces for the short records? Does that mean the short records should be padded with blanks up to and including the 4 spaces or what? If padding is required, then an IFTHEN WHEN=INIT clause could be used. If padding is not required, then IFTHEN WHEN=(cond) clauses could be used to handle the short records and non-short records differently. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I assumed that when the OP mentioned 2108 he was counting the RDW, so I suggested:
Code: |
OUTREC BUILD=(1,2108,4X,2109)
|
If the OP was not counting the RDW (which well may be the case), then it would be:
Code: |
OUTREC BUILD=(1,2112,4X,2113)
|
as Arun suggested.
I really wish people who use this Forum would learn how to describe their requirements correctly. It gets really tedious having to guess at what people want.
A perfect example is:
Quote: |
Hi Frank,
It does not seems to be working.
Thanks
Ajay |
How is anyone expected to help given that little piece of non-information.
Sheesh. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
When I'm running the job with below sysin:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5,2112,2117:2113,11)
/*
I'm getting an abend : outrec RDW not included. |
Unbelievable. You ignored everything everyone said in this thread!
You don't include the RDW and get an error message saying you didn't include it and still can't figure out that you didn't include it.
The message indicates you're using Syncsort, so I'll drop out now. Good luck (you'll need it). |
|
Back to top |
|
|
|