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 inSyncsort

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

New User


Joined: 02 Feb 2010
Posts: 14
Location: hyderabad

PostPosted: Tue Dec 14, 2010 6:10 pm    Post subject: Problem inSyncsort
Reply with quote

Hi,

I am having three fields (A,B,C) in my input file. I want to generate the report if the VALUES in field A is ''1'' the out put should be written into the
field ''B''. If the values of A is ''2'' the put put should be written into the place of B. I need the OUTREC for this.

Thanks,
Rajesh
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Dec 14, 2010 6:30 pm    Post subject: Re: Problem inSyncsort
Reply with quote

elijarajesh.mf wrote:
I am having three fields (A,B,C) in my input file. I want to generate the report if the VALUES in field A is ''1'' the out put should be written into the
field ''B''. If the values of A is ''2'' the put put should be written into the place of B. I need the OUTREC for this.

What have YOU tried so far and what were the results.

Please post some useful information, including the release level of the product.

RECFM, LRECL of input / output datasets.
Length, position and format of key fields.
Examples of input and output.
Rules for generating the output

Please use the code tags for posting data, output, etc etc
Back to top
View user's profile Send private message
elijarajesh.mf
Warnings : 1

New User


Joined: 02 Feb 2010
Posts: 14
Location: hyderabad

PostPosted: Tue Dec 14, 2010 6:44 pm    Post subject:
Reply with quote

My Input file is having length of 13 bytes and the output file is having 80 bytes which is the Reoprt. In the below Scenario if the 1st byte is having the Value as ""I"" I want to write below the INTERSTATE and other than ''I"" I want to write the output below the INTRASTATE.

Here is my SORT Card:
Code:
  SORT FIELDS=(1,5,CH,A,12,2,CH,A)                             
  SUM FIELDS=(6,6,PD)                                           
  OUTFIL REMOVECC,                                             
         HEADER1=(2:'PAGE ',                                   
                  8:PAGE,//,                                   
                  2:'JOB XXXXXX RPT XXXXXXXX',//,               
                  23:'REVENUES FOR XXX',/,                     
                  17:'BY STATE BY ROAD FOR',/,                 
                  16:'PREPARED ',DATE=(MD4/),' AT ',TIME),     
        HEADER2=(//,18:'INTERSTATE      ','INTRASTATE  ',/,     
                  2:'STATE  ','ROAD',/,                         
                  2:'----------------------------------',       
                 36:'---------------------------'/),           
         OUTREC=(12,2,5X,2,4,5X,6,6,PD,EDIT=(I,III,IIT.TT),52X)
 /*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Dec 14, 2010 6:59 pm    Post subject:
Reply with quote

Your explanation of the problem does not seem to make any sense. Can you post a few realistic input records and the expected output out of it.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Dec 29, 2010 11:55 pm    Post subject:
Reply with quote

Here is an example that may help you.
Code:
//SORT1 EXEC PGM=SORT                                       
//SORTIN  DD *                                               
1ROADXXXXXXST                                               
2ROADYYYYYYST                                               
//SORTOUT DD SYSOUT=*                                       
//SYSOUT  DD SYSOUT=*                                       
//SYSIN   DD *                                               
 SORT FIELDS=(1,5,CH,A,12,2,CH,A)                           
 OUTFIL REMOVECC,                                           
          HEADER1=(2:'PAGE ',                               
                   8:PAGE,//,                               
                   2:'JOB XXXXXX RPT XXXXXXXX',//,           
                   23:'REVENUES FOR XXX',/,                 
                   17:'BY STATE BY ROAD FOR',/,             
                   16:'PREPARED ',DATE=(MD4/),' AT ',TIME), 
          HEADER2=(//,18:'INTERSTATE      ','INTRASTATE  ',/,         
                   2:'STATE  ','ROAD',/,                               
                   2:'----------------------------------',             
                  36:'---------------------------'/),                 
          IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),BUILD=(12,2,5X,2,4,5X,18:6,6)),
          IFTHEN=(WHEN=NONE,BUILD=(12,2,5X,2,4,5X,34:6,6,80:X))       
/*                                                                     

Here is the output produced:
Code:
 PAGE                                                         
                                                             
 JOB XXXXXX RPT XXXXXXXX                                     
                                                             
                      REVENUES FOR XXX                       
                BY STATE BY ROAD FOR                         
               PREPARED 12/29/2010 AT 13:20:34               
                                                             
                                                             
                 INTERSTATE      INTRASTATE                   
 STATE  ROAD                                                 
 -------------------------------------------------------------
                                                             
ST     ROAD      XXXXXX                                       
ST     ROAD                      YYYYYY                       

If this is not the desired output, then as Arun had requested, please provide sample input records along with the expected output.

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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7: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 Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


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