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
 

 

Combine the same file using keys :

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

New User


Joined: 24 Feb 2009
Posts: 14
Location: chennai

PostPosted: Mon Apr 20, 2009 6:09 pm    Post subject: Combine the same file using keys :
Reply with quote

Input - FB/80

Code:


ID : ABC       /* KEY */
A123
A345
ID : ABC       /* KEY */
678H
T789
ID : CDE       /* KEY */
F768
T789
U890
ID : CDE       /* KEY */
G890
7890
ID : FGH        /* KEY */
6789
ID : IJK        /* KEY */
8990
0569


Output FB/80

Code:


ABC   A123
ABC   A345
ABC   678H
ABC   T789
CDE   F768
CDE   T789
CDE   U890
CDE   G890
CDE   7890
FGH   6789
IJK   8990
IJK   0569


The key (1,3) position however in some records it wnt be there. Once it got changed we need to group them in to other. with the word "ID :" we can identify the key. Please look over this !
Back to top
View user's profile Send private message

Escapa

Senior Member


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

PostPosted: Mon Apr 20, 2009 6:33 pm    Post subject:
Reply with quote

Hi below solution will give you required output...
but please not that as you have mentioned op as FB and lrecl=80,
and in output you want 3bytes of from header and 3 spaces after that,
you will loose last 6 bytes of detail line from input file..
Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *             
ID : ABC       /* KEY */     
A123                         
A345                         
ID : ABC       /* KEY */     
678H                         
T789                         
ID : CDE       /* KEY */     
F768                         
T789                         
U890                         
ID : CDE       /* KEY */     
G890                         
7890                         
ID : FGH        /* KEY */                                           
6789                                                                 
ID : IJK        /* KEY */                                           
8990                                                                 
0569                                                                 
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=COPY                                                   
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ID :'),PUSH=(81:6,3)),
        IFTHEN=(WHEN=NONE,BUILD=(81,3,3X,1,74))                     
  OUTFIL INCLUDE=(7,4,CH,NE,C'ID :')                                 
/*                                                                   
Back to top
View user's profile Send private message
vpalanivelu

New User


Joined: 24 Feb 2009
Posts: 14
Location: chennai

PostPosted: Mon Apr 20, 2009 8:04 pm    Post subject:
Reply with quote

I'm getting a SYNTAX error in INREC. I ve used the same code
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 Apr 20, 2009 8:13 pm    Post subject:
Reply with quote

vpalanivelu wrote:
I'm getting a SYNTAX error in INREC. I ve used the same code
Post your output.
Back to top
View user's profile Send private message
vpalanivelu

New User


Joined: 24 Feb 2009
Posts: 14
Location: chennai

PostPosted: Mon Apr 20, 2009 8:15 pm    Post subject:
Reply with quote

we are having 1 SYNCSORT FOR Z/OS 1.2.2.1R .. will it support WHEN=GROUP, If not plz provide some other solutions
Back to top
View user's profile Send private message
vpalanivelu

New User


Joined: 24 Feb 2009
Posts: 14
Location: chennai

PostPosted: Mon Apr 20, 2009 8:20 pm    Post subject:
Reply with quote

Code:

 SYNCSORT FOR Z/OS  1.2.2.1R    U.S. PATENTS: 4210961, 5117495   (C)
                                            SYSIN :                                                             
   SORT FIELDS=COPY                                                 
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'ID :'),PUSH=(81:6,3)),
        *                                                           
         IFTHEN=(WHEN=NONE,BUILD=(81,3,3X,1,74))                     
   OUTFIL INCLUDE=(7,4,CH,NE,C'ID :')                               
 WER268A  INREC STATEMENT   : SYNTAX ERROR                           
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                       
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                       
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 Apr 20, 2009 8:26 pm    Post subject:
Reply with quote

Since IFTHEN is not available on you old release, try TRAILER3.......
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Mon Apr 20, 2009 10:24 pm    Post subject:
Reply with quote

IFTHEN is supported in SyncSort for z/OS 1.2.2.1. However, support for WHEN=GROUP was included as of SyncSort for z/OS 1.3.2.0.
Back to top
View user's profile Send private message
vpalanivelu

New User


Joined: 24 Feb 2009
Posts: 14
Location: chennai

PostPosted: Tue Apr 21, 2009 1:48 pm    Post subject:
Reply with quote

IFTHEN is permitted however WHEN=GROUP is not supporting as we are using older version. I ve done with that by easytrieve.
Thank you one and all.
One more question usign TRAILER3 we can have the totals by SECTIONS right? How it will be helped here ?
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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