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
 

 

Need to change report with DOS/VSE Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Thu Apr 29, 2010 10:57 pm    Post subject: Need to change report with DOS/VSE Syncsort
Reply with quote

Hi,
I have a report which looks like this and is sorted based on EMPID with header and total.

Code:
EMPID|AGENTNAME|SAL   
1111 |BALU     |100
2222 |SANDY    |200 
3333 |CINDY    |300
4444 |DAS      |150
TOTAL|         |750

I want a new report, and it should be sorted on AGENTNAME with header at top and total at bottom. When i use SYNC SORT with SORT FIELDS=(7,9,CH,A) to sort on AGENTNAME it displays like this :

Code:
TOTAL|         |750
EMPID|AGENTNAME|SAL
3333 |CINDY    |300
1111 |BALU     |100
4444 |DAS      |150   
2222 |SANDY    |200 
Please help me on how to do this using sort?

Regards,
Balraj
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 29, 2010 11:09 pm    Post subject:
Reply with quote

Please provide lrecl and recfm .
Please post your original JCL.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 29, 2010 11:51 pm    Post subject:
Reply with quote

William, Even this needs to be moved to JCL part.

Balraj, Can you confirm you are getting WER* messages and not ICE* messages? Because you have posted to DFSORT part of the forum and you are pretty old to forum.
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Thu Apr 29, 2010 11:59 pm    Post subject: Reply to: Need to change report with syncsort
Reply with quote

Thompson,

Recfm is Fixed and Lrecl=100


SORT FIELDS=(7,9,CH,A)
RECORD TYPE=F,LENGTH=100
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: Fri Apr 30, 2010 12:15 am    Post subject: Re: Reply to: Need to change report with syncsort
Reply with quote

Balraj wrote:
SORT FIELDS=(7,9,CH,A)
RECORD TYPE=F,LENGTH=100
I think by "Please post your original JCL." he meant all of it.....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 30, 2010 2:19 am    Post subject:
Reply with quote

Hello,

Quote:
I think by "Please post your original JCL." he meant all of it.....
Yup, and for whatever reason None of the jcl was posted. . . Only some of the sort control statements. . .
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Apr 30, 2010 1:31 pm    Post subject:
Reply with quote

You can use ICETOOL's DATASORT operator to sort the data records |in a data set without sorting the header or trailer records. You |use the following operands to tell DATASORT the number of header records, |trailer records, or header and trailer records in your data set:

||HEADER or FIRST - |the first record is a header record |HEADER(x) or FIRST(x) - |the first x records are header records |TRAILER or LAST - |the last record is a trailer record |TRAILER(y) or LAST(y) - |the last y records are trailer records
|DATASORT does not require an "identifier" in the header or trailer |records; it can treat the first x records as header records and the |last y records as trailer records.

|You must specify a USING data set to specify a DFSORT SORT statement |that tells DATASORT the fields you want to use to sort your data records. | You can use various other DFSORT statements as well; see z/OS DFSORT Application Programming Guide for |details.

|DATASORT sorts the data records between your header records (first |x records of the data set) and trailer records (last y records of |the data set) while keeping the header and trailer records in place.

So for this example I am assuming the EMPID as the key.

So the control statement for ICETOOL will become like this.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT DSN....
//OUT DD DSN=OUTPUT DSN...
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*

//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A)

/*


Just in case if you have 2 trailers then it changes like this.
Code:

DATASORT FROM(IN) TO(OUT) HEADER TRAILER(2) USING(CTL1)


Hope this helps.....
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 189
Location: INDIA

PostPosted: Fri Apr 30, 2010 7:17 pm    Post subject:
Reply with quote

If you want to do with only syncsort then try this below code.
I have given only the control statements
Code:

INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'EMP'),OVERLAY=(81:C'0'),
              WHEN=(1,3,CH,EQ,C'TOT'),OVERLAY=(81:C'2'),
              WHEN=NONE,OVERLAY=(81:C'1'))
SORT FIELDS=(81,1,ZD,A,1,4,CH,A)
OUTREC BUILD=(1,80)



Hope this helps...
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Fri Apr 30, 2010 9:02 pm    Post subject: Reply to: Need to change report with syncsort
Reply with quote

Hi,

Let me tell you guys that I work on z/VSE and my JCL is below
Code:
* $$ JOB JNM=T99SRT,DISP=D,CLASS=T,PRI=5,USER='       ',SYSID=4           
* $$ LST CLASS=Q,DISP=D,LST=SYS095,SYSID=3                               
// JOB T99SRT                                                             
// DLBL SORTOUT,'TEST.SORTFILE2'                                       
// DLBL SORTIN1,'TEST.SORTFILE1'                                       
// EXEC PGM=SORT,SIZE=400K                                               
   INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'EMP'),OVERLAY=(101:C'0'),             
                 WHEN=(1,3,CH,EQ,C'TOT'),OVERLAY=(101:C'2'),             
                 WHEN=NONE,OVERLAY=(101:C'1'))                           
   SORT FIELDS=(101,1,ZD,A,11,4,CH,A)                                     
   OUTREC BUILD=(1,100)                                                   
   RECORD TYPE=F,LENGTH=100                                               
   END                                                                   
/*       

Iam getting a syntax error with the code
WER047A INREC STATEMENT HAS SYNTAX ERROR

Assist me on this.

Thankyou.
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: Fri Apr 30, 2010 9:13 pm    Post subject:
Reply with quote

Quote:
Iam getting a syntax error with the code
WER047A INREC STATEMENT HAS SYNTAX ERROR

Assist me on this.
Then post the entire error messages.....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 30, 2010 9:14 pm    Post subject:
Reply with quote

Quote:
Iam getting a syntax error with the code
You need to post all of the output messages (including message ids) that were generated by the problem run.
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Fri Apr 30, 2010 9:16 pm    Post subject: Reply to: Need to change report with syncsort
Reply with quote

hi,

Let me correct myself .. All the job streams in my system as I mentioned earlier. So the instrem is starting from 4th pos
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 30, 2010 9:17 pm    Post subject:
Reply with quote

Hello,

Now post the requested info from the problem run. . .
Back to top
View user's profile Send private message
Balraj

New User


Joined: 16 Aug 2007
Posts: 34
Location: Bangalore

PostPosted: Fri Apr 30, 2010 11:45 pm    Post subject: Reply to: Need to change report with syncsort
Reply with quote

hi,

Following is the JCL used......

Code:
* $$ JOB JNM=T99SRT,DISP=D,CLASS=T,PRI=5,USER='',SYSID=4                 
* $$ LST CLASS=Q,DISP=D,LST=SYS095,SYSID=3                               
// JOB T99SRT                                                             
// DLBL SORTOUT,'TEST.SORTFILE2'                                         
// DLBL SORTIN1,'TEST.SORTFILE1'                                         
// EXEC PGM=SORT,SIZE=400K                                               
   INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'CLI'),OVERLAY=(101:C'0'),             
                 WHEN=(1,3,CH,EQ,C' TO'),OVERLAY=(101:C'2'),             
                 WHEN=NONE,OVERLAY=(101:C'1'))                           
   SORT FIELDS=(101,1,ZD,A,11,4,CH,A)                                     
   OUTREC BUILD=(1,100)                                                   
   RECORD TYPE=F,LENGTH=100                                               
   END                                                                   
/*                                                                       
/&                                                                       

Here is the error message on the console....

Code:
0002 // JOB T99SRT                                                 
     DATE 04/30/2010, CLOCK 11/12/36                               
0002    WER047A  INREC STATEMENT HAS SYNTAX ERROR                   
0002    WER234A  DIAG= 00000000 00000000 00000000 00000400 00370000
00000                                                               
0002    WER400A  CRITICAL ERROR, SORT TERMINATED                   
0002    WER117A  PHASE 0 HAS CRITICAL ERROR                         
0002 0S02I A CANCEL OR CANCEL ALL MACRO WAS ISSUED                 
0002 0S00I JOB T99SRT   CANCELED                                   
0002 0S07I PROBLEM PROGRAM  PSW = 07BD0000 0061329A                 
0002 1S78I  JOB TERMINATED DUE TO  PROGRAM ABEND                   
0002 EOJ T99SRT
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: Sat May 01, 2010 12:14 am    Post subject:
Reply with quote

Sorry, but I just don't have the VSE Syncsort manual, maybe Alissa can help....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 01, 2010 1:47 am    Post subject:
Reply with quote

Hello,

Is there not some output that has Syncsort information at the top of the page? There should be some "printout" that was generated by Syncsort and not the DOS system. . .

Look at the output from another sort that is working. It will produce information about the process that was run (record counts, dsorg, etc). We need that same info from the problem run.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat May 01, 2010 7:06 am    Post subject:
Reply with quote

Hi,

from what I can see the INREC statement is incorrect,
you need an IFTHEN before each WHEN statement.

Try this although it has not been tested on any DOS/VSE system.
I can't imagine that the parameters would vary if any.
Code:
   INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'EMP'),OVERLAY=(101:C'0')),   
         IFTHEN=(WHEN=(1,3,CH,EQ,C'TOT'),OVERLAY=(101:C'2')),   
         IFTHEN=(WHEN=NONE,OVERLAY=(101:C'1'))                   
   SORT FIELDS=(101,1,ZD,A,7,9,CH,A)                             
   OUTREC BUILD=(1,80)                                           
   END                                                           


Gerry
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon May 03, 2010 10:28 pm    Post subject:
Reply with quote

Balraj,

Gerry's modified INREC statement is correct. That should work fine. Please let us know if you continue to encounter a problem after making this change.

Regards,
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: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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