Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to expand a file with sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
hcl_ln

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Fri Feb 23, 2007 1:19 am    Post subject: How to expand a file with sort
Reply with quote

Hello,

i/p file is of LRECL=100
o/p file is of LRECL=140

The difference between i/p file & o/p file is:
some new fields were introduced into the o/p file from the positions in the i/p file as: 20-39, 60-79.

I am trying to copy the whole i/p file records into the o/p file new format.

I tried the below code and it's not working.

OPTION COPY
OUTFIL OUTREC=(1:19,19,41:59,20,80:140,61)

Can some body tell me how to achieve this using SORT.

Title edited
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Fri Feb 23, 2007 2:07 am    Post subject:
Reply with quote

Hello,

Please post your jcl & control statements as "code" and post the message(s) you got back from the sort.

From what you've posted there is no way to tell which sort you are executing.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Feb 23, 2007 2:25 am    Post subject:
Reply with quote

hcl,

You description of what you're trying to do is very confusing.

However, you say that your input file has LRECL=100 (or is it LRECL=140?), but your OUTREC operand has 140,61 which is trying to copy input positions 140-200. You can't copy bytes that don't exist in the record. If the record length is 100, you can't copy bytes beyond position 100. With DFSORT, you would have received this message:

ICE027A 9 END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH

You need to rewrite your OUTREC operand to only include valid bytes from the input record.

Quote:
Can some body tell me how to achieve this using SORT.


You need to explain more clearly what you're trying to do before we can help you.

And whenever something is "not working", you need to post the messages you received.
Back to top
View user's profile Send private message
hcl_ln

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Fri Feb 23, 2007 2:31 am    Post subject:
Reply with quote

Hello "dick scherrer",

Thanks for the reply.
Here is my step and the error messages.

//*------------------------------------------------------------
//SORT1 EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=A.B.C,disp=shr --> LRECL=100
//SORTOUT DD DSN=D.E.F, --> LRECL=140
// UNIT=SYSDA,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=140)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(1:19,19,41:59,20,80:140,61)
/*
//*

While trying to copy the whole i/p file records into the o/p file new format
I am getting the error message as:

WER230A SORTOUT OUTREC FIELD OUTSIDE RANGE
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

I know that the i/p file is of 100 lrecl and the o/p file is 140 lrecl.
But how can I include the new field postions 20-39, 60-79 in the o/p file in the SORT SYSIN card?

Your help is much appreciated.

Thanks,
Back to top
View user's profile Send private message
hcl_ln

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Fri Feb 23, 2007 2:37 am    Post subject:
Reply with quote

Frank,

that was a typo. sorry.

here is what I am trying to copy:

I/p file o/p file
(LRECL=100) (LRECL=140)
pos 1-19 pos-19
pos 20-39 ( new field positions in my o/p file)
pos 41-59 pos 41-59
pos 60-79 ( new field positions in my o/p file)
pos 80-100 pos 80-100

Hope this helps,

Thanks for your time,
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 3:46 am    Post subject:
Reply with quote

This should help:
OUTFIL OUTREC=(1:1,19,20:20X,40:20,20,60:20Z,80:39,61)
1:1,19, the first 19 bytes of the original file
20:20X, 20 empty bytes of blanks
40:20,20, the next 20 bytes of the original file
60:20Z, 20 empty bytes of binary zero
80:39,61 the next (and last) 61 bypts of the original file
It's all in the manual, you do have a manual, don't you?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Feb 23, 2007 4:57 am    Post subject:
Reply with quote

Hello hcl_ln,

From the messages, you are using Syncsort (as opposed to DFSORT).

Please try what Bill suggested and post back with any new opportunities or if all goes well.

Good Luck icon_smile.gif
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 10:41 am    Post subject:
Reply with quote

Hi HCl_in,

Little change in bills card .it should be

Code:
OUTFIL OUTREC=(1:1,19,20:20X,40:20,20,60:20X,80:39,61)
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 11:30 am    Post subject:
Reply with quote

guptae wrote:
Little change in bills card .it should be
OUTFIL OUTREC=(1:1,19,20:20X,40:20,20,60:20X,80:39,61)
I'm sorry Etka, what did I miss, what is the little change?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 11:32 am    Post subject:
Reply with quote

HI There,

Bill U wrote

Quote:
This should help:
OUTFIL OUTREC=(1:1,19,20:20X,40:20,20,60:20Z,80:39,61)


It should be 20X its a typo

OUTFIL OUTREC=(1:1,19,20:20X,40:20,20,60:20X,80:39,61)
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 11:47 am    Post subject:
Reply with quote

Since there was no specification for the fill, I thought an example of how to blank fill and one of how to binary zero fill was a nice idea.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 11:58 am    Post subject:
Reply with quote

Hi Bill,

I am sorry for that its my mistake icon_cry.gif
Back to top
View user's profile Send private message
hcl_ln

New User


Joined: 14 Sep 2005
Posts: 21

PostPosted: Fri Feb 23, 2007 7:24 pm    Post subject:
Reply with quote

Thank You everybody for the sincere comments.
I really appreciate the help.
I can take it from here and build on the necessary further req's.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us