Header date to overlay on all subsequent records

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Header date to overlay on all subsequent records

Post by carlosd » Mon Sep 14, 2009 6:26 pm

I have a file which contains a date in the header (YYYMMDD), and I need to add/overlay this to each subsequent data record along with a sequence number.

The sequence number I have found, and have got that OK - but I am unable to find out how to carry down the header date.

Any help would be appreciated !
Carlos

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Sep 14, 2009 8:21 pm

Please show an example of the records in your input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Mon Sep 14, 2009 8:41 pm

This is the header record with the date starting in pos 28 and ending in pos 35

........XXXXXXXXXIV0000421920090905

LRECL - 3094, RECFM FB

I have the same records being output, same length etc - but at pos 3076 I need the date (acquired from the header) on each record followed by the sequence number (which I have found how to do)

200909050000000001
0000000002
0000000003
0000000004

I managed to get the date to be output on the hdr record in pos 3076, but I don't know how to carry it down to subsequent records so it should appear like :-

200909050000000001
200909050000000002
200909050000000003
200909050000000004

It's as if I want to put the date to a working storage field which can be used in the detail records as well.

I have been through several of the ICETOOL/DFSORT manuals but can't find what should relate to this.

Thanks !
Carlos

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Mon Sep 14, 2009 8:43 pm

carlosd wrote:
200909050000000001
0000000002
0000000003
0000000004
Don't know why that didn't come out correctly - but the above is actually

200909050000000001

and then the following sequence numbers are preceded by 8 spaces
0000000002
0000000003
0000000004

Thanks
Carlos

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Mon Sep 14, 2009 9:11 pm

Here's a DFSORT job that will do what you asked for:

Code: Select all

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/3094)
//SORTOUT DD DSN=...  output file (FB/3094)
//SYSIN    DD    *
  OPTION COPY
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(3084:SEQNUM,10,ZD)),
   IFTHEN=(WHEN=GROUP,BEGIN=(3084,10,ZD,EQ,1),
    PUSH=(3076:28,8))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Tue Sep 15, 2009 2:38 pm

Thanks for the help.

It appears that our installation does not accept the syntax for WHEN=GROUP

We have
SYNCSORT FOR Z/OS 1.3.1.0
and then
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(3084:SEQNUM,10,ZD)),
IFTHEN=(WHEN=GROUP,BEGIN=(3084,10,ZD,EQ,1),
*
PUSH=(3076:28,8))
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Thanks
Carlos

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Tue Sep 15, 2009 3:50 pm

Here's the output formatted properly :-

Code: Select all

SYSIN :
  OPTION COPY
    INREC IFTHEN=(WHEN=INIT,OVERLAY=(3084:SEQNUM,10,ZD)),
    IFTHEN=(WHEN=GROUP,BEGIN=(3084,10,ZD,EQ,1),
                 *
     PUSH=(3076:28,8))
WER268A  INREC STATEMENT   : SYNTAX ERROR
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Carlos

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Tue Sep 15, 2009 6:55 pm

I think I have answered my own question - it appears that WHEN=GROUP came in with V1.5 and we are on V1.3

Do you know if there is any other solution if WHEN=GROUP cannot be used ?

Thanks !
Carlos

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Sep 15, 2009 8:14 pm

The job works fine with DFSORT. The WER messages indicate you're using Synsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

carlosd
Member
Posts: 7
Joined: Mon Sep 14, 2009 6:20 pm

Post by carlosd » Tue Sep 15, 2009 8:29 pm

Oh OK - Thanks for the help anyway - we have ICEMAN and ICETOOL as well so assumed it was all part of the same thing - apologies.
Carlos

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Sep 15, 2009 8:58 pm

You have Syncsort. Syncsort ships ICEMAN and ICETOOL as aliases so if you have Syncsort, PGM=ICEMAN or PGM=SORT invokes Syncsort and PGM=ICETOOL invokes Syncsort's SYNCTOOL. If you had DFSORT (ICE messages), PGM=ICEMAN and PGM=SORT would invoke DFSORT and PGM=ICETOOL would invoke DFSORT's ICETOOL.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
arcvns
Member
Posts: 28
Joined: Sat May 30, 2009 10:19 pm
Location: Chennai, India

Post by arcvns » Thu Sep 17, 2009 11:22 pm

it appears that WHEN=GROUP came in with V1.5 and we are on V1.3
Carlos,

You're running SYNCSORT FOR Z/OS 1.3.1. "WHEN=GROUP" is supported by the latest version of SyncSort which is SYNCSORT FOR Z/OS 1.3.2.
Do you know if there is any other solution if WHEN=GROUP cannot be used ?
Yes. This is untested. You can try this SYMNAMES approach as an alternative to the WHEN=GROUP solution posted above.

Code: Select all

//SORT001 EXEC PGM=SORT        
//SYSOUT   DD SYSOUT=*          
//SORTIN   DD DSN=...Input-file (FB/LRECL=3094)                
//SORTOUT  DD DSN=&&T1,DISP=(,PASS)          
//SYSIN    DD *                  
  SORT FIELDS=COPY,STOPAFT=1              
  OUTREC BUILD=(C'DATE-X,''',28,8,C'''',80:X) 
//SORT002 EXEC PGM=SORT        
//SYSOUT   DD SYSOUT=*          
//SYMNAMES DD DSN=&&T1,DISP=(OLD,PASS)              
//SORTIN   DD DSN=...Input-file  (FB/LRECL=3094)                
//SORTOUT  DD DSN=...Output-file (FB/LRECL=3094)            
//SYSIN   DD *                  
  INREC OVERLAY=(3076:DATE-X,SEQNUM,11,ZD) 
  SORT FIELDS=COPY
Arun

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 10:28 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others