View previous topic :: View next topic
|
Author |
Message |
krishnakanagal
New User
Joined: 27 Feb 2009 Posts: 12 Location: Bangalore
|
|
|
|
Hi,
I have a file A which has a record size 8 bytes and it has date in it in ddmmyyy format.
File A
29032010
there is also a file B record size 32756 variable block.
File B
qweqweqw123123123
asdasdas1231231233232
234kjdfjf794579394
output required is
29032010123123123
290320101231231233232
29032010794579394
I have to replace the first 8 bytes of my file B with the date in file A. how do i do using SORT? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this might help
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD * input filea
29032010
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'NDATE,''',1,8,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=input fileb
// DISP=SHR
//SORTOUT DD DSN=output-file
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,4,NDATE,13)
/*
|
Gerry |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
I tried executing this JCL and I am getting the below error,
WER231A OUTREC - ILLEGAL DATA FIELD
Jcl code below..
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
29032010
/*
//SORTOUT DD DSN=A024277.S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),
// DISP=(,CATLG,DELETE)
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'NDATE,''',1,8,C'''',80:X)
/*
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=A024277.S1,DISP=SHR
//SYMNOUT DD SYSOUT=*
//SORTIN DD DSN=A024277.TEST2,
// DISP=SHR
//SORTOUT DD DSN=A024277.TEST3,DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,4,NDATE,13)
/*
|
Anything missing here Gerry? or I am missing something! |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
my job was tested using DFSORT and not SYNCSORT (WER messages) as posted in DFSORT/ICETOOL forum.
When you get an error, you need to show the entire job output.
Try allocating the output file with correct DCB attributes, they should be same as the input file.
Better still, create the file as in S1 step, do not pre-allocate it.
Gerry |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
All the 3 datasets are alike w.r.t attributes.. there is no problem there. Here is the full output of the error messages,
Code: |
SYNCSORT FOR Z/OS 1.3.2.1N U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNC
z/OS 1.9.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER D7B9E, MODEL 2097 710 LIC
SYSIN :
OPTION COPY
OUTREC BUILD=(1,4,NDATE,13)
DATA DICTIONARY SYMBOLS SUBSTITUTED :
OPTION COPY
OUTREC BUILD=(1,4,C'29032010',13)
WER276B SYSDIAG= 981069, 2608684, 2608684, 1892017
WER164B 8,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,012K BYTES USED
WER146B 12K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 27920
WER231A OUTREC - ILLEGAL DATA FIELD
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what happened to this
Quote: |
there is also a file B record size 32756 variable block. |
Now input file is
Code: |
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 27920 |
Which one is correct ?
If the second is correct then use
Code: |
OPTION COPY
OUTREC BUILD=(NDATE,9,72)
|
Gerry |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Hi Gerry,
The question was initially asked by another user. Not me!
I was simply trying out the jcl code posted by you as I could not understand the OUTREC options used there. All my files are FB=80.
Now I understand that in OUTREC=(1,4..) was used to accomodate the first 4 bytes of VB right..?
Now its working fine.. and I got the OUTREC logic that was employed by you. Thanks for your time. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Technut,
I didn't realise I was dealing with a different user, I apologise.
Quote: |
Now I understand that in OUTREC=(1,4..) was used to accomodate the first 4 bytes of VB right..?
|
and yes you are correct.
Gerry |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
I guessed so! No problem at all. Got a chance to learn something new..
Thanks for the clarification. |
|
Back to top |
|
|
|
|