|
View previous topic :: View next topic
|
| Author |
Message |
sridevi2005
New User
Joined: 15 Sep 2005 Posts: 42
|
|
|
|
I'm struggling with SORT card to sort the variable length format.
I used the following code
| Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SAB67D.G4662V00.TEST,DISP=SHR
//SORTOUT DD DSN=DFG37D.DFG0GF.TEST,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE)
//SYSIN DD *
OPTION COPY,VLSHRT
INCLUDE COND=(85,1,CH,EQ,C'Y',1,3,ZD,CH,120)
/*
|
85 position contains character
1 to 3 postion contains numeric fileds.
And I need output file with 2 bytes stating from 4 to 5th positions in the input file. These two bytes are comp-3 value.
Thanks,
Sridevi |
|
| Back to top |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Sridevi,
In a VB file the first 4 bytes are for RDW (which have the length of the record ans zeroes). You need to add four bytes in all the sort conditions.
If your field starts from position 1 of length 2- code 5,2
Code and post the error if you still face the problem |
|
| Back to top |
|
 |
sridevi2005
New User
Joined: 15 Sep 2005 Posts: 42
|
|
|
|
Hi,
Thank u very much for the reply.
I have used the following code its working fine.
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SAB67D.G4662V00.TEST,DISP=SHR
//SORTOUT DD DSN=DFG37D.DFG0GF.TEST,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
OPTION VLSHRT
SORT FIELDS=COPY
INCLUDE COND=(89,1,CH,EQ,C'Y',AND,5,3,ZD,EQ,120)
But When I tried the following code its giving error.
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SAB67D.G4662V00.TEST,DISP=SHR
//SORTOUT DD DSN=DFG37D.DFG0GF.TEST,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE),
// RECFM=FB,LRECL=10,DSORG=PS
//SYSIN DD *
OPTION VLSHRT
SORT FIELDS=COPY
INCLUDE COND=(89,1,CH,EQ,C'Y',AND,5,3,ZD,EQ,120)
OUTREC FIELDS=(8,2)
Can u look into this.
Thanks in advance.
Sridevi |
|
| Back to top |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
| Please Post the error message that you are getting |
|
| Back to top |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Srideivi,
Replace your last statement in the SORT card with the one given below
| Code: |
| OUTREC BUILD=(1,4,8,2) |
|
|
| Back to top |
|
 |
sridevi2005
New User
Joined: 15 Sep 2005 Posts: 42
|
|
|
|
Hi,
I'm getting the following error.
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=VB ; LRECL= 288; BLKSIZE= 27998
WER235A OUTREC RDW NOT INCLUDED
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
| Back to top |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Sridevi,
Change the last statement as per my last post.
Whenever you use BUILD parameter for VB datasets, you must begin your INREC/OUTREC statement fields by specifying 1,4 for RDW. |
|
| Back to top |
|
 |
sridevi2005
New User
Joined: 15 Sep 2005 Posts: 42
|
|
|
|
Wow......
Its working fine.
Thank u very much for your support. |
|
| Back to top |
|
 |
Aaru
Senior Member

Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
You are welcome  |
|
| Back to top |
|
 |
jmreddymca Warnings : 1 New User
Joined: 14 Oct 2007 Posts: 29 Location: Bangalore
|
|
|
|
Hi sridevi
we can do in this way also it will work fine.
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:5,150),VTOF
/*
my i/p file length hs 255
i copied this into fb length of 150 .
you can try. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|