Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Problem with SYNCSORT
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    Post subject: Re: Problem with SORT
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Mon Nov 12, 2007 4:04 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Nov 12, 2007 4:13 pm    Post subject: Reply to: Problem with SORT
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Mon Nov 12, 2007 4:16 pm    Post subject: Reply to: Problem with SORT
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us