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
 

 

Build single output from multiple inputs

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

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Wed Feb 23, 2011 1:55 pm    Post subject: Build single output from multiple inputs
Reply with quote

Please find below my reqmt:
Input files :LRECL 133 FB
XXXX.file1.data
XXXX.file2.data
XXXX.file3.data
File content
Code:
XXXX.file1.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000008                                               
                 DELETED 00000005                                                 
XXXX.file2.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000058                                               
                 DELETED 00000000                                                 
XXXX.file3.data
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
                 WRITTEN 00000658                                               
                 DELETED 00000000     

Output file :
LRECL 80 FB
File name Rec count

Code:
DATE : 2011-02-22 or any date format
XXXX.file1.data : WRITTEN - 00000008 DELETED 00000005 ( OR ZERO SUPPRESSED)
XXXX.file2.data : WRITTEN - 00000058 DELETED 00000000
XXXX.file3.data : WRITTEN - 00000658 DELETED 00000000


Can anyone help me to acheive the result in SORT.
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: Thu Feb 24, 2011 12:09 am    Post subject:
Reply with quote

Is

XXXX.file1.data

a record in the input file, or is it just the name of the dsname for that file?

DFSORT cannot obtain the dsname for a file automatically. You would have to specify it somehow. Given that, do you still want me to show you how to do this with DFSORT's GROUP function?
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Thu Feb 24, 2011 7:56 am    Post subject:
Reply with quote

Thanks Frank, I will try with GROUP function.
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Thu Mar 03, 2011 2:03 pm    Post subject:
Reply with quote

Hi Frank/Radhakrishnan,
Would you be able to show me how this can be achieved without using a ICETOOL step with only a GROUP for this scenario, please? I have a similar requirement where I would have to accomplish this in a single step but not using ICETOOL.

Thanks,
Ashwin.
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: Thu Mar 03, 2011 8:49 pm    Post subject:
Reply with quote

Hello,

By now you should know you need to post some sample input and the output you want from the sample input (not necessarily complete records, but only the relevant fields). You also should mention the recfm and lrecl of the files. Post the "rules" for getting from the input to the output.

If someone is to spend time doing this for you, you need to at least provide info about what you want to accomplish. . .
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: Thu Mar 03, 2011 11:32 pm    Post subject:
Reply with quote

Quote:
I have a similar requirement where I would have to accomplish this in a single step but not using ICETOOL.


Why?
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Fri Mar 04, 2011 1:03 pm    Post subject:
Reply with quote

Hi Dick/Frank,
I agree. But I thought I will try to extrapolate if someone showed me how it can be done for this particular scenario.
Anyway, I will provide my case here..

I have a file which has blocks of two records as in the example below. First record has to be compared with the second record. The comparision has to be between the delimiter values. The comparision result has to be the third record on the output. If it has a mismatch, we would have a 'Y', else it would be spaces as in the example below. Finally, the last record in the report will give us the count of 'Y' (mismatch values) columnwise. Here, when I say columnwise, it means each value between the delimiters. There are 25 such colums on my report, but I have mentioned only 3 in the sample below for the ease of explaining. Each column is about 10 bytes long. The LRECL=292 and RECFM=FB.

Input:
Code:

BEFORE  IMG:-    000100000 ¦BALAJI   ¦DATA
AFTER  IMG:-      000100000 ¦ARNOLD ¦DATA
BEFORE  IMG:-    000200000 ¦XXXXXX ¦DATA
AFTER  IMG:-      000200000 ¦XXXXXX ¦DATA1
BEFORE  IMG:-    000300000 ¦XXXXX1 ¦DATA2
AFTER  IMG:-      000300000 ¦XXXXX1 ¦DATA2


Output:
Code:


BEFORE  IMG:-    000100000 ¦BALAJI   ¦DATA
AFTER  IMG:-      000100000 ¦ARNOLD ¦DATA
MISMATCH IND:-                 ¦  Y
BEFORE  IMG:-    000200000 ¦XXXXXX ¦DATA
AFTER  IMG:-      000200000 ¦XXXXXX ¦DATA1
MISMATCH IND:-                 ¦             ¦   Y
BEFORE  IMG:-    000300000 ¦XXXXX1 ¦DATA2
AFTER  IMG:-      000300000 ¦XXXXX1 ¦DATA2
MISMATCH IND:-                 ¦             ¦   
MISMATCH TOT:-      0         ¦   1        ¦   1




Quote:

Why?


My folks here are against me using a ICETOOL solution whenever I comeup with one. But they are okay with a SORT solution and so I thought I will use this post as a template and try to build mine without a ICETOOL. Moreover, I had posted my ICETOOL solution here but it was deleted which I thought was correct as the solution was requested in SORT and not ICETOOL.

Please let me know your comments

Thanks,
Ashwin.
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: Sat Mar 05, 2011 2:20 am    Post subject:
Reply with quote

I suspect JOINKEYS and lots of IFTHEN statements would be required to do this.

Are the fields actually in fixed positions in each record? For example, field 1 is always in positions 18-27, field2 is always in positions 29-35, and so on? If so, please give the starting position and length of each field.

Or can each field actually be variable length and delimited? If so, give the maximum length of each field.

Where do you want the 'Y' in each column? First character? Last character? Or what? Where do you want the total in each column and how long should it be?

Please run this job and show the //SYSOUT messages you receive, so I can see what level you're at:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Back to top
View user's profile Send private message
hailashwin

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Mon Mar 07, 2011 5:54 pm    Post subject:
Reply with quote

Hi Frank,
I think I possibly found a solution when I tried to build it based on your solution in

Quote:
http://ibmmainframes.com/about53667.html


First of all, I will try to answer your questions.

Quote:

Are the fields actually in fixed positions in each record? For example, field 1 is always in positions 18-27, field2 is always in positions 29-35, and so on? If so, please give the starting position and length of each field.

The fields are all in fixed positions. I think the data got misaligned on this page when I submitted here. Each of the columns are 10 bytes long and their starting positions are 18, 29 and 40 respectively for the First, second and third columns.
Quote:

Where do you want the 'Y' in each column? First character? Last character? Or what?

The 'Y's have to be almost at the middle of each delimited field. This also has to be delimited.
Quote:

Where do you want the total in each column and how long should it be?

The totals has to be the trailing record, giving the totals column wise and the number should be almost in the middle of each delimited field.
Quote:

Please run this job and show the //SYSOUT messages you receive, so I can see what level you're at:


Code:

SYSIN :                                                                       
    OPTION COPY                                                         0000980
WER276B  SYSDIAG= 11205082, 16502744, 16502744, 5676075                       
WER164B  6,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
WER164B     0 BYTES RESERVE REQUESTED, 272K BYTES USED                         
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER410B  5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,       
WER410B     0 BYTES RESERVE REQUESTED, 156K BYTES USED                         
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 
WER416B  BSAM WAS USED FOR SORTIN                                             
WER416B  BSAM WAS USED FOR SORTOUT                                             
WER054I  RCD IN          1, OUT          1                                     
WER169I  RELEASE 1.3 BATCH 0494 TPF LEVEL 2.0                                 
WER052I  END SYNCSORT - A491815B,S1,,DIAG=A000,6244,8806,00C4,E8FA,4CCB,8A08,86


This is how my control card looks like when I tried to build it for a LRECL=80, RECFM=FB.

Code:

//S1 EXEC PGM=SORT                         
//SYSOUT DD SYSOUT=*                       
//SORTIN DD *                               
BEFORE  IMG:-    000100000 ¦BALAJI     ¦DATA
AFTER   IMG:-     000100000 ¦ARNOLD    ¦DATA
BEFORE  IMG:-    000200000 ¦XXXXXX    ¦DATA
AFTER   IMG:-     000200000 ¦XXXXXX    ¦DATA1
BEFORE  IMG:-    000300000 ¦XXXXX1    ¦DATA2
AFTER   IMG:-     000300000 ¦XXXXX1    ¦DATA2
//SORTOUT DD  SYSOUT=*
//SYSIN DD *                                                       
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,13,CH,EQ,C'BEFORE  IMG:-'),     
                      RECORDS=2,PUSH=(200:SEQ=1)),                 
   IFTHEN=(WHEN=(200,1,ZD,EQ,2),                                   
                BUILD=(81:1,80,200:200,1,260:C'¦',271:C'¦',350:C'0',
                       361:C'0',372:C'0'))                         
  OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(200,1,ZD,EQ,1),                 
                RECORDS=2,PUSH=(1:1,80)),                           
   IFTHEN=(WHEN=(18,10,CH,NE,98,10,CH),                             
                OVERLAY=(250:C'     Y    ',350:C'1'),HIT=NEXT),     
   IFTHEN=(WHEN=(29,10,CH,NE,109,10,CH),                           
                OVERLAY=(261:C'     Y    ',361:C'1'),HIT=NEXT),     
   IFTHEN=(WHEN=(40,10,CH,NE,120,10,CH),                           
                OVERLAY=(272:C'     Y    ',372:C'1'))               
   OUTFIL FNAMES=SORTOUT,INCLUDE=(200,1,ZD,EQ,2),REMOVECC,         
          TRAILER1=(1:C'MISMATCH TOT:-',                           
                   22:TOT=(350,1,ZD,M10,LENGTH=2),28:C'¦',         
                   33:TOT=(361,1,ZD,M10,LENGTH=2),39:C'¦',         
                   44:TOT=(372,1,ZD,M10,LENGTH=2),           
                   80:X),                                     
         BUILD=(1,80,/,81,80,/,C'MISMATCH IND:-',3X,250,32)   



Please let me know your comments..

Thanks,
Ashwin.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Mar 07, 2011 6:54 pm    Post subject:
Reply with quote

The "WER" in your messages indicate that you are using SYNCSORT, not DFSORT. This question should be asked in the JCL forum.

Garry.
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: Mon Mar 07, 2011 8:15 pm    Post subject:
Reply with quote

Topic moved.
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 Mar 07, 2011 9:00 pm    Post subject:
Reply with quote

Hello,

At the top of the informational output generated (above the messages) the release is shown. It will probably help someone help you if you post this line also.
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 Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 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
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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