|
View previous topic :: View next topic
|
| Author |
Message |
hcl_ln
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
 |
hcl_ln
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
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 |
|
 |
hcl_ln
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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  |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| 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 |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
Hi Bill,
I am sorry for that its my mistake  |
|
| Back to top |
|
 |
hcl_ln
New User
Joined: 14 Sep 2005 Posts: 21
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|