IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SyncSort card required to expand in between field of a file.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Sun Sep 28, 2008 5:10 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Sun Sep 28, 2008 5:16 pm
Reply with quote

OUTREC FIELDS=(1,2118,4Z,2119,14)
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Sun Sep 28, 2008 7:56 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Sep 28, 2008 8:14 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Sep 29, 2008 11:43 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Sep 29, 2008 12:49 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Sep 29, 2008 11:54 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 30, 2008 10:00 am
Reply with quote

HI Dick,

I didn't wonder it's a curiosity rather..
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Sep 30, 2008 10:57 am
Reply with quote

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
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 4:59 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 02, 2008 5:07 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 02, 2008 5:39 am
Reply with quote

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
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 5:51 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 02, 2008 5:58 am
Reply with quote

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
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 6:23 am
Reply with quote

Hi Frank,

It does not seems to be working.

Thanks
Ajay
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 02, 2008 6:27 am
Reply with quote

Hi,

maybe this
Code:
  OUTREC BUILD=(1,2108,4X,2109)


can only apply to records GE 2113 bytes long.


Gerry
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 6:37 am
Reply with quote

Can any one explain what is RDW related to VB file.?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 02, 2008 6:48 am
Reply with quote

Hi Ajay,

see Type_Description_Herehttp://ibmmainframes.com/viewtopic.php?t=34145&highlight=rdw


Gerry
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 7:01 am
Reply with quote

HI All,

Any one have idea about my previous query?
How to sort a VB file with Outrec?

Thanks
AJAY.
Back to top
View user's profile Send private message
ajay_udl

New User


Joined: 10 Oct 2006
Posts: 29

PostPosted: Thu Oct 02, 2008 7:26 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 02, 2008 9:28 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Oct 02, 2008 5:12 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 02, 2008 8:34 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 02, 2008 8:42 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 02, 2008 8:47 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top