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

Problem inSyncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Dec 14, 2010 6:30 pm
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
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: 2481
Location: @my desk

PostPosted: Tue Dec 14, 2010 6:59 pm
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: 496
Location: USA

PostPosted: Wed Dec 29, 2010 11:55 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top