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

Problem with SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tarun_bhardwaj

New User


Joined: 18 Jul 2003
Posts: 39
Location: delhi

PostPosted: Mon Nov 12, 2007 3:19 pm
Reply with quote

Hi,

Iam facing a problem with sort. Earlier, I was using the following:

Code:
//PS005   EXEC PGM=SORT                                     
//SYSOUT   DD  SYSOUT=*                                     
//SORTIN   DD DSN=FNBV.OTPD,DISP=SHR                       
//SORTOUT  DD DSN=PRD.TYB.VSAM.SORT,                       
//             DISP=(NEW,CATLG,DELETE),                     
//             MGMTCLAS=STANDARD,STORCLAS=BASE,             
//             AVGREC=K,SPACE=(84,(1,200),RLSE),           
//             RECFM=FB,LRECL=84                           
//SYSIN    DD    *                                         
  SORT FIELDS=COPY                                         
  INCLUDE COND=(7,5,CH,EQ,C'CHGBK',AND,125,3,CH,EQ,C'AF2') 
  OUTREC FIELDS=(1,1,C'3',440,26)                           
  END                                                       
 /*                                                         


Here, FNBV.OTPD is a VSAM file. Iam trying to build a file PRD.TYB.VSAM.SORT that would contain character '3' in the first position and the timestamp in the next 26 bytes. The problem that Iam facing here is that when the file PRD.TYB.VSAM.SORT is built, it contains low values in the first position, character '3' in the next position and then the timestamp in the next 26 bytes and then low values again till the end of the record.

The output file looks like:
Code:
 BROWSE    PRD.TYB.VSAM.SORT                          Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> CSR 
********************************* Top of Data **********************************
.32007-11-02-13.33.07.284070....................................................
.32007-11-02-13.33.06.718349....................................................
.32007-11-02-13.33.18.533797....................................................
.32007-11-02-13.33.18.566379....................................................
.32007-11-02-13.33.18.588427....................................................
.32007-11-02-13.33.18.754139....................................................
.32007-11-02-13.33.18.966327....................................................
.32007-11-02-13.33.17.471974....................................................
.32007-11-02-13.33.14.552540....................................................
.32007-11-02-13.33.14.596246....................................................
.32007-11-02-13.33.13.701777....................................................



Now, when I change the record length to 27 (since I just need a total of 27 bytes in my file), it give me an abend with the following message:

Code:
SYSIN :                                                                   
  SORT FIELDS=COPY                                                         
  INCLUDE COND=(7,5,CH,EQ,C'CHGBK',AND,125,3,CH,EQ,C'AF2')                 
  OUTREC FIELDS=(1,1,C'3',440,26)                                         
  END                                                                     
WER276B  SYSDIAG= 1354522, 1710850, 1710850, 455297                       
WER164B  10,924K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,       
WER164B     0 BYTES RESERVE REQUESTED, 3,052K BYTES USED                   
WER146B  20K BYTES OF EMERGENCY SPACE ALLOCATED                           
WER108I  SORTIN   : RECFM=F    ; LRECL=  2276; CISIZE =  4096             
WER237I  OUTREC RECORD LENGTH =    28                                     
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    27; BLKSIZE= 27972             
WER247A  SORTOUT  HAS INCOMPATIBLE LRECL                                   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000


Can some one pls help me with this and let me know where am going wrong.
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Mon Nov 12, 2007 3:37 pm
Reply with quote

Remove 1,1 from OUTREC FIELDS=(1,1,C'3',440,26) and Try....
Back to top
View user's profile Send private message
tarun_bhardwaj

New User


Joined: 18 Jul 2003
Posts: 39
Location: delhi

PostPosted: Mon Nov 12, 2007 3:55 pm
Reply with quote

Great ! that worked ! just for the sake of my curiosity, why was 1,1 giving a problem there ?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Nov 12, 2007 4:04 pm
Reply with quote

Probably because the second 1 specified what byte from the input you wanted placed at that position (the first 1) in the output.....
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Nov 12, 2007 4:13 pm
Reply with quote

Tarun,

Quote:
OUTREC FIELDS=(1,1,C'3',440,26)


As per the above condition you are first writing

1) One byte starting from the 1st position
2) A character "3" in the 2nd position
3) Then 26 bytes starting from the 440th position.

You dont have to specify LRECL for your output dataset as SORT will take care of the same. Try executing the JCL removing the LRECL parameter. The output dataset would be allocated with record length 28. Try and let us know.
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Mon Nov 12, 2007 4:13 pm
Reply with quote

Hi Tarun,

The answer to your query is:

OUTREC FIELDS=(1,1,C'3',440,26)

Here 1,1 means :-->First byte of the input field
C'3' means :--->A charector '3'
440,26 :---->26 bytes from input file starting from position 440

Hence you were getting the extra "First byte of the input field" in your output file.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Nov 12, 2007 4:16 pm
Reply with quote

Cics Guy,

Quote:
Probably because the second 1 specified what byte from the input you wanted placed at that position (the first 1) in the output.....


Second byte (1) indicates the length and the first byte (1) specifies the starting position in the input file. So 1 byte of data starting from position 1 in the input file would be written to the output.
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 Compare only first records of the fil... SYNCSORT 7
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top