View previous topic :: View next topic
|
Author |
Message |
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
How to retrieve certain columns of a dataset
for ex i need only from col 20 to 30 |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Radhika,
You can use sort for this.
Please use following sort card
Code: |
OPTION COPY
OUTFIL OUTREC=(1:20,10) |
|
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
it is showing some syntax error at outfil...and job getting abended |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
Hi Radhika,
Please post ur jcl and error message.
Thanks,
Rajen. |
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
//SYSIN DD *
SORT FIELDS=COPY
SORTOUT=(1:59,48)
/*
Sortout is my output file....correct me |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hey radhika,
Ur shop has syncosrt or dfsort? |
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
syncosrt
Thanks
Radhika |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Radhika,
Code: |
it is showing some syntax error at outfil...and job getting abended |
Please provide ur jcl & error message |
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
//SYSIN DD *
SORT FIELDS=COPY
SORTOUT=(1:59,48)
/*
Sytax error at sortout...Sortout is my outout dd name |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hey radhika,
Please give this as a sortcard
OPTION COPY
OUTFIL OUTREC=(1:20,10) |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
This is what Ekta suggested you.
Code: |
OPTION COPY
OUTFIL OUTREC=(1:20,10) |
This is what you are using.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
SORTOUT=(1:59,48)
/* |
I guess it should be OUTREC instead of SORTOUT!!!!
Thanks,
Rajen Patel. |
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=....,DISP=SHR
//SORTOUT DD DSN=.....
//SYSIN DD *
SORT FIELDS=COPY
OUTREC=(1:59,10)
/*
This is what am using am still getting same pblm |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
Please paste your error message.
I dont know but u should not get this error message.
Thanks,
Rajen. |
|
Back to top |
|
|
m.radhika
New User
Joined: 28 Mar 2006 Posts: 7
|
|
|
|
SYSIN :
SORT FIELDS=COPY
OUTREC=(1:59,10)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Am getting above error message |
|
Back to top |
|
|
h.dinesh
New User
Joined: 06 Dec 2006 Posts: 46 Location: Chennai
|
|
|
|
Radhika,
It should be
OUTREC FIELDS=(1:59,10)
Dinesh |
|
Back to top |
|
|
Rajen
New User
Joined: 05 May 2005 Posts: 61
|
|
|
|
Hi Radhika,
Can you please try the code as Ekta has given you and please let us know if it worked or not.
Thanks,
Rajen Patel. |
|
Back to top |
|
|
reddy307 Currently Banned New User
Joined: 09 Jun 2006 Posts: 18
|
|
|
|
Hi
Try this
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(7:2,5,20:10,3)
/*
EXPLANATION
1. SORT FIELDS=COPY
It is for copy records to output file
2. INREC FIELDS=(7:2,5,20:10,3) (for formatting)
Here we have two formattings,
1. 7:2,5 - data at 2nd position of input file with length 5
copied to 7th position of output file
2. 20:10,3 - data at 10th position of input file with length 3
copied to 20th position of output file
In above example, we can use OUTREC instread of INREC,
INREC adds, deletes, or reformats fields before the
records are sorted or merged. so that performance will
be improved
OUTREC adds, deletes, or reformats fields after the
records are sorted or merged. |
|
Back to top |
|
|
|