Header date to overlay on all subsequent records
Moderators: Frank Yaeger, Moderator Group
Header date to overlay on all subsequent records
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 !
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
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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 !
........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
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
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
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
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
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Carlos,it appears that WHEN=GROUP came in with V1.5 and we are on V1.3
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.
Yes. This is untested. You can try this SYMNAMES approach as an alternative to the WHEN=GROUP solution posted above.Do you know if there is any other solution if WHEN=GROUP cannot be used ?
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
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
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page