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

How to expand a file with sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Feb 23, 2007 2:07 am
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 Developer


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

PostPosted: Fri Feb 23, 2007 2:25 am
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
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 3:46 am
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

Moderator Emeritus


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

PostPosted: Fri Feb 23, 2007 4:57 am
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: 1208
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 10:41 am
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 11:30 am
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: 1208
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 11:32 am
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: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 11:47 am
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: 1208
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 11:58 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top