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
 

 

Syncsort - How to select records and merge with another DS

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

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Mon Nov 10, 2008 8:48 pm    Post subject: Syncsort - How to select records and merge with another DS
Reply with quote

Hi,
Here is the requirement;

I have two DataSet's
One DS is having some 1000 records out of which i want to select only 25 records with Business group: EXPRESS CASH starting from position 25.
attached scrn shot1.

Other DS is having 25 recrods with data distributed in 4 columns, out of which i want the last column to be merged output of first ds.
here is the scrn shot2:
please let me know the solution.
Back to top
View user's profile Send private message

sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Mon Nov 10, 2008 9:25 pm    Post subject: Reply to: How to select perticular records and merge with an
Reply with quote

can you please explain me how to do the plain cut with code tag's.
I will do that and report .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Nov 10, 2008 10:47 pm    Post subject:
Reply with quote

Surya,

I deleted your screen shots. They were very difficult to read.

You need to do a better job of explaining what you want to do. Show an example of the records in your input files (relevant fields only) and what you expect for output. Just post your records as text (surround them with ubb code tags if possible - if not, I'll do it for you). Explain the "rules" for getting from input to output. Give the RECFM and LRECL of your input files. Give the starting position, length and format of all relevant fields.
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: Mon Nov 10, 2008 10:56 pm    Post subject:
Reply with quote

Hello,

Quote:
can you please explain me how to do the plain cut with code tag's.
Near the top of the Reply panel is the "Code" tag. You can copy/paste from your 3270-screen and paste into the reply. Once the "screen" is in the editor, highlight the screen inifo and click Code. Then click Preview to see how your post will appear.

You can continue to edit and Preview until you like the way the post will appear to the forum, then click Submit.

You would also use the "Code" tag to post code, jcl, control statements, or data. "Coding" makes the post more readable (green on black) and preserves alignment.
Back to top
View user's profile Send private message
sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 12:12 am    Post subject: Reply to: How to select perticular records and merge with an
Reply with quote

Input File 1:
Rec Length: 133
Rec Fm: FBA
Selection field starting position '25'
Selection Text : 'CASH' in the business group 'Express cash'

Input would have multiple Business groups
Scenario: I would have various Business groups in the Input file, but I want to take only for "Express Cash".

Code:
BUSINESS GROUP EXPRESS CASH                                           
  BILLING     ------INTERNAL SPENDING-----  ------EXTERNAL SPENDING----
  CURRENCY                                                             
                  FLAT           FLAT       MARKED-UP        MARKED-UP
             BILLING AMOUNT   US ¢ EQUIV   BILLING AMOUNT   US ¢ EQUIV
                                                                       
AUSTRIAN EURO      3,280.97       4,336.43           0.00           0.0
BELGIAN EURO       4,493.46       5,939.00           0.00           0.0
UK STERLING      205,258.29     341,980.50           0.00           0.0
                                                                       
BUSINESS GROUP HUNGARY DIRECT PAY                                     
  BILLING     ------INTERNAL SPENDING-----  ------EXTERNAL SPENDING----
  CURRENCY                                                             
                  FLAT           FLAT       MARKED-UP        MARKED-UP
             BILLING AMOUNT   US ¢ EQUIV   BILLING AMOUNT   US ¢ EQUIV
                                                                       
U.S.¢ EUROPE           0.00           0.00         404.39         404.3
FRENCH EURO            0.00           0.00          26.33          34.4
GERMAN EURO            0.00           0.00          11.75          15.3


Output : should have only values for Business group 'Express Cash'
Code:
BUSINESS GROUP EXPRESS CASH                                           
  BILLING     ------INTERNAL SPENDING-----  ------EXTERNAL SPENDING----
  CURRENCY                                                             
                  FLAT           FLAT       MARKED-UP        MARKED-UP
             BILLING AMOUNT   US ¢ EQUIV   BILLING AMOUNT   US ¢ EQUIV
                                                                       
AUSTRIAN EURO      3,280.97       4,336.43           0.00           0.0
BELGIAN EURO       4,493.46       5,939.00           0.00           0.0
UK STERLING      205,258.29     341,980.50           0.00           0.0
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Nov 11, 2008 12:27 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. The job uses DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FBA/133)
//SORTOUT DD DSN=...  output file (FBA/133)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
    BEGIN=(2,14,CH,EQ,C'BUSINESS GROUP'),
    PUSH=(134:25,4))
  OUTFIL INCLUDE=(134,4,CH,EQ,C'CASH'),BUILD=(1,133)
/*


If you don't have z/OS DFSORT PTF UK90013, ask your System Programmer to install it (it's free).

For complete details on the new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 11:03 am    Post subject: Reply to: How to select perticular records and merge with an
Reply with quote

I got the below abend:

Code:
SYSIN :                                             
  OPTION COPY                                       
   INREC IFTHEN=(WHEN=GROUP,                         
        *                                           
   BEGIN=(2,14,CH,EQ,C'BUSINESS GROUP'),             
   PUSH=(134:25,4))                                 
   OUTFIL INCLUDE=(134,4,CH,EQ,C'CASH'),BUILD=(1,133)
WER268A  INREC STATEMENT   : SYNTAX ERROR           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE       

Please advise
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: Tue Nov 11, 2008 11:12 am    Post subject:
Reply with quote

Hello,

You asked your question in the DFSORT part of the forum.

You are using Syncsort, not DFSORT.

What release of Syncsort are you running (it is listed at the top of the informational output from any sort)?

GROUP is not available in even the most current version of Syncsort - it is quite new to DFSORT.
Back to top
View user's profile Send private message
sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 11:29 am    Post subject: Reply to: Syncsort - How to select records and merge with an
Reply with quote

I am sorry to bother you,
Can you please explain me how this can be done with out dfsort
either thru other JCl utilities. If possible.
Back to top
View user's profile Send private message
sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 11:30 am    Post subject:
Reply with quote

am using the release SYNCSORT FOR Z/OS 1.2.3
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: Tue Nov 11, 2008 11:33 am    Post subject:
Reply with quote

Hello,

No bother icon_smile.gif

Someone may be able to show a way to do this with Syncsort. It would have to be a differnt approach as GROUP is not part of Syncsort.

For someone to help, they would need to know what version of Syncsort you are running.

If i needed this quickly, i would start writing a bit of code to do what was wanted.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Nov 11, 2008 5:06 pm    Post subject:
Reply with quote

Hi,

if you have FILEAID, you can use the following
Code:
//FILEAID  EXEC PGM=FILEAID                                             
//SYSPRINT DD SYSOUT=*                                                 
//DD01     DD *                                                         
BUSINESS GROUP EXPRESS CASH                                             
  BILLING     ------INTERNAL SPENDING-----  ------EXTERNAL SPENDING----
  CURRENCY                                                             
                  FLAT           FLAT       MARKED-UP        MARKED-UP 
             BILLING AMOUNT   US ¢ EQUIV   BILLING AMOUNT   US ¢ EQUIV 
                                                                       
AUSTRIAN EURO      3,280.97       4,336.43           0.00           0.0
BELGIAN EURO       4,493.46       5,939.00           0.00           0.0
UK STERLING      205,258.29     341,980.50           0.00           0.0
                                                                       
BUSINESS GROUP HUNGARY DIRECT PAY                                       
  BILLING     ------INTERNAL SPENDING-----  ------EXTERNAL SPENDING----
  CURRENCY                                                             
                  FLAT           FLAT       MARKED-UP        MARKED-UP 
             BILLING AMOUNT   US ¢ EQUIV   BILLING AMOUNT   US ¢ EQUIV 
                                                                       
U.S.¢ EUROPE           0.00           0.00         404.39         404.3
FRENCH EURO            0.00           0.00          26.33          34.4
GERMAN EURO            0.00           0.00          11.75          15.3
//DD01O    DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
$$DD01 SPACE STOP=(16,EQ,C"EXPRESS CASH")                               
$$DD01 COPY  OUT=1                                                     
$$DD01 COPY  STOP=(01,EQ,C"BUSINESS GROUP")                             
/*



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

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 7:13 pm    Post subject:
Reply with quote

It's Working....

Thank you Very much gcicchet
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Nov 11, 2008 7:13 pm    Post subject:
Reply with quote

Hi surya,

Here's a SYNCTOOL job which works for your requirement. Try this and post back if you face any issues.
Code:
//STEP01  EXEC PGM=SYNCTOOL                                         
//TOOLMSG   DD SYSOUT=*                                             
//DFSMSG    DD SYSOUT=*                                             
//IN        DD DSN= Input file  ---- FBA,LRECL=133                   
//OUT       DD DSN= Output file ---- FBA,LRECL=133                   
//TOOLIN    DD *                                                     
 SPLICE FROM(IN) TO(OUT) ON(134,8,CH) WITHALL WITH(1,133) -         
             KEEPBASE KEEPNODUPS USING(CTL1)                         
//CTL1CNTL  DD *                                                     
 INREC IFTHEN=(WHEN=INIT,                                           
         OVERLAY=(134:SEQNUM,8,ZD)),                                 
       IFTHEN=(WHEN=(2,14,CH,EQ,C'BUSINESS GROUP'),                 
         OVERLAY=(134:SEQNUM,8,ZD),HIT=NEXT),                       
       IFTHEN=(WHEN=(2,22,CH,EQ,C'BUSINESS GROUP EXPRESS CASH'),     
         OVERLAY=(150:C'S')),                                       
       IFTHEN=(WHEN=NONE,                                           
    OVERLAY=(142:SEQNUM,8,ZD,134:142,8,ZD,SUB,134,8,ZD,M11,LENGTH=8))
 OUTFIL INCLUDE=(150,1,CH,EQ,C'S'),BUILD=(1,133)
Back to top
View user's profile Send private message
sdurvasu

New User


Joined: 14 Apr 2008
Posts: 15
Location: chennai

PostPosted: Tue Nov 11, 2008 7:51 pm    Post subject:
Reply with quote

Gave RC=16 with below message;


Code:
WER428I  CALLER-PROVIDED IDENTIFIER IS "0001"   
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT

Code:
SYNCTOOL RELEASE 1.5.3 - COPYRIGHT 2004  SYNCSORT INC.               
INITIAL PROCESSING MODE IS "STOP"                                     
"TOOLIN" INTERFACE BEING USED                                         
                                                                     
 SPLICE FROM(IN) TO(OUT) ON(134,8,CH) WITHALL WITH(1,133) -           
             KEEPBASE KEEPNODUPS USING(CTL1)                         
SYNCSORT CALLED WITH IDENTIFIER "0001"                               
SYNCSORT COMPLETED UNSUCCESSFULLY                                     
OPERATION COMPLETED WITH RETURN CODE 16                               
                                                                     
PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
                                                                     
SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 16                     


Thank you arcvns very much for your code.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Nov 11, 2008 8:43 pm    Post subject: Reply to: Syncsort - How to select records and merge with an
Reply with quote

please, please do not double post about the same issue in different topics,
it will not help to get consistent replies ,
if You find somebody willing to help, probably he/she will take You up to the solution of Your problem,
asking different people to spend time on Your issues is, just.... bad manners
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Nov 11, 2008 8:52 pm    Post subject:
Reply with quote

surya,

The jcl which I provided worked fine for me with whatever data you provided. If you're looking for a sort solution, you may post the DFSMSG output here which explains the actual reason for failure.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 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