|
View previous topic :: View next topic
|
| Author |
Message |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi,
I am using the below JCL and please suggest the issue with RECFM
| Code: |
//SRT01#03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN1 DD DSN=XXXXXXXX.YESTERDY.ATMEPEXN,DISP=SHR
//SORTOUT1 DD DSN=&&EXTRACT1,DISP=(NEW,PASS),
// DCB=(RECFM=VB,LRECL=2052),
// SPACE=(CYL,(300,50)),UNIT=(SYSDA,4)
//SYSIN DD *
SORT FIELDS=(21,100,A),FORMAT=BI
END
/*
//*
//SRT02#03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN2 DD DSN=XXXXXXXX.TODAY.AAAAPEXN,DISP=SHR
//SORTOUT2 DD DSN=&&EXTRACT2,DISP=(NEW,PASS),
// DCB=(RECFM=VB,LRECL=2052),
// SPACE=(CYL,(300,50)),UNIT=(SYSDA,4)
//SYSIN DD *
SORT FIELDS=(21,100,A),FORMAT=BI
END
//*
//SRT03#03 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=&&EXTRACT1,DISP=SHR
//SORTJNF2 DD DSN=&&EXTRACT2,DISP=SHR
//YESTONLY DD DSN=P2D.TEST.EXTRACT.YESTONLY,
//* DISP=(NEW,CATLG),
// DISP=OLD,
// DCB=(RECFM=VB,LRECL=2052),
// SPACE=(CYL,(120,120)),UNIT=SYSDA
//TODYONLY DD DSN=P2D.TEST.EXTRACT.TODYONLY,
//* DISP=(NEW,CATLG),
// DISP=OLD,
// DCB=(RECFM=VB,LRECL=2052),
// SPACE=(CYL,(120,120)),UNIT=SYSDA
//COMMON DD DSN=P2D.TEST.EXTRACT.COMMON,
//* DISP=(NEW,CATLG),
// DISP=OLD,
// DCB=(RECFM=VB,LRECL=2052),
// SPACE=(CYL,(120,120)),UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//SYSIN DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(21,100,A),SORTED,NOSEQCK,TYPE=V
JOINKEYS FILE=F2,FIELDS=(21,100,A),SORTED,NOSEQCK,TYPE=V
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:21,100,F2:21,100,?)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=YESTONLY,INCLUDE=(201,1,CH,EQ,C'1'),
BUILD=(21,100)
OUTFIL FNAMES=TODYONLY,INCLUDE=(201,1,CH,EQ,C'2'),
BUILD=(21,100)
OUTFIL FNAMES=COMMON,INCLUDE=(201,1,CH,EQ,C'B'),
BUILD=(21,100,/,21,100)
/*
//* |
THE OUTPUT ERROR IN SYSOUT ;
| Code: |
********************************* TOP OF DATA **********************************
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=201
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE162I 0 ICEIEXIT CHANGED ONE OR MORE OPTIONS IN EFFECT
ICE043A 9 INVALID DATA SET ATTRIBUTES: YESTONLY RECFM - REASON CODE IS 14
ICE751I 0 C5-K76982 C6-K90026 C7-K82419 C8-K67572 E9-K60824 E7-K79990
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 10:57 ON FRI M
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(21,100,A),SORTED,NOSEQCK,TYPE=V
JOINKEYS FILE=F2,FIELDS=(21,100,A),SORTED,NOSEQCK,TYPE=V
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:21,100,F2:21,100,?)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=YESTONLY,INCLUDE=(201,1,CH,EQ,C'1'),
BUILD=(21,100)
OUTFIL FNAMES=TODYONLY,INCLUDE=(201,1,CH,EQ,C'2'),
BUILD=(21,100)
OUTFIL FNAMES=COMMON,INCLUDE=(201,1,CH,EQ,C'B'),
BUILD=(21,100,/,21,100)
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=201
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE162I 0 ICEIEXIT CHANGED ONE OR MORE OPTIONS IN EFFECT
ICE043A 9 INVALID DATA SET ATTRIBUTES: YESTONLY RECFM - REASON CODE IS 14
ICE751I 0 C5-K76982 C6-K90026 C7-K82419 C8-K67572 E9-K60824 E7-K79990
ICE052I 3 END OF DFSORT
******************************* BOTTOM OF DATA ******************************** |
|
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| What does the error message suggest to you once you have looked it up in the relevant manual? |
|
| Back to top |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
| Possibly a quick solution is, just don't code the DCB for YESTONLY and see what happens. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Why have you got TYPE=V on the two JOINKEYS? Everything points to the data being Fixed, and you don't need to specify TYPE except where the manual indicates you do. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
hi Nic,
I have to give get the output in the same format as input. Like all 2052 bytes need to be there in output files.
When testing with YESTONLY DD SYSOUT=* its working fine and giving me the output with 100 bytes. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi Anuj,
I need the same DCB parameter for the output file and all the 2052 bytes . the criteria is from column 17 to next 100 byte the compare is done. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Think about it. If you got 100 bytes on SYSOUT, how many do you think you are going to get on an output dataset? SYSOUT is FIXED, and that "works" for you, so how do you think your output dataset can "magically" become "variable"? |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi Bill,
I am using the JOINKEYS first time and not sure how to make it 2052 and VB. The EZYTRIEVE I used is working fine:
| Code: |
FILE ORIGTRAN
REC-ORIG 1 2052 A
KEY-ORIG 17 100 A
*
FILE NEWTRAN
REC-NEW 1 2052 A
KEY-NEW 17 100 A
FILE DELACB
REC-DEL 1 2052 A
FILE INSACB
REC-INS 1 2052 A
FILE MTCHACB
REC-MTCH 1 2052 A
OREC1 1 2052 A
FILE REPORT01 PRINTER
JOB INPUT( ORIGTRAN KEY(KEY-ORIG) -
NEWTRAN KEY(KEY-NEW))
IF MATCHED ORIGTRAN, NEWTRAN
* DISPLAY 'MATCHED '
OREC1 EQ REC-ORIG
PUT MTCHACB
GO TO JOB
END-IF
IF ORIGTRAN
* DISPLAY 'EXTRA - ORIG' KEY-ORIG
REC-DEL = REC-ORIG
PUT DELACB
GO TO JOB
END-IF
IF NEWTRAN
* DISPLAY 'EXTRA - NEW ' KEY-NEW
REC-INS = REC-NEW
PUT INSACB
GO TO JOB
END-IF
*
* |
|
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
In Easytrieve you should replace those assignments with either MOVE filename-1 TO filename-2 and then the PUT filename-2, or use PUT filename-2 FROM filename-1.
The difference to your JOINKEYS step is that there you are outputting fixed 100-byte records with the BUILD.
What is it that you actually want to do in the JOINKEYS? |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
I got two files
1) Yesterday File
2) Today File
But the frontend says that there are some records which they sent in both file. We can not process the same record twice so I want to remove. So, in YESTONLY file I need those records which are only for Yesterday, TODYONLY will contain those records which are for today. And the common will contain which are present in both file. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, but in your JOINKEYS, on the REFORMAT you are using only the keys from either file and the "match marker" (?).
When you use your OUTFILs, you are BUILDing records which only contains your key.
Your key is 100 bytes, fixed in length, your OUTFIL outputs will be 100 bytes, fixed in length.
You have DCBs indicating VB. So you have a clash. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
| so, can you please suggest the BUILD and how to make the output as VB. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You have an Easytrieve program already, why do you want the Sort solution, particularly?
The REFORMAT can easily handle one variable-length piece of data. Two, you're going to have to research.
Make a couple of small VB files, with records of different lengths.
| Code: |
REFORMAT FIELDS=(F1:1,4,5,20,?,F2,1,5,5)
|
Put you SORTOUT to a dataset, browse the dataset. If that doesn't help, post a few records here, in HEX. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1217 Location: Dublin, Ireland
|
|
|
|
Instead of:
| Code: |
REFORMAT FIELDS=(F1:21,100,F2:21,100,?)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=YESTONLY,INCLUDE=(201,1,CH,EQ,C'1'),
BUILD=(21,100)
OUTFIL FNAMES=TODYONLY,INCLUDE=(201,1,CH,EQ,C'2'),
BUILD=(21,100)
OUTFIL FNAMES=COMMON,INCLUDE=(201,1,CH,EQ,C'B'),
BUILD=(21,100,/,21,100) |
try :
| Code: |
REFORMAT FIELDS=(F1:1,2052,F2:1,2052,?)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=YESTONLY,INCLUDE=(4104,1,CH,EQ,C'1'),
BUILD=(1,2052)
OUTFIL FNAMES=TODYONLY,INCLUDE=(4104,1,CH,EQ,C'2'),
BUILD=(2053,2052)
OUTFIL FNAMES=COMMON,INCLUDE=(4104,1,CH,EQ,C'B'),
BUILD=(1,2052) * or BUILD=(2053,2052)
|
... and remove DCB information from the output files.
Garry |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
'cept those will get you FB.
EDIT:
| Manual wrote: |
| If the REFORMAT statement only defines position with length (p,m) fields, each joined record will be fixed-length (TYPE=F) with a LENGTH equal to the total length of all of the p,m fields. The maximum length for TYPE=F joined records is 32760 bytes. The F1 and F2 files can both be fixed-length, both be variable-length, or can be mixed fixed-length and variable-length. |
So, the REFORMAT will be F, and you can't just later make a variable-length record by happening to have a binary value. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
You can create Variable Record after Join when you have a tail.
abhijit.nayak01,
Get rid off all your steps and just run this single step which will give you the desired results. You do not have to code DCB properties as DFSORT can automatically calculate them for you.
| Code: |
//SRT03#03 EXEC PGM=SORT,REGION=0M
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DISP=SHR,DSN=XXXXXXXX.YESTERDY.ATMEPEXN
//SORTJNF2 DD DISP=SHR,DSN=XXXXXXXX.TODAY.AAAAPEXN
//*
//YESTONLY DD DSN=P2D.TEST.EXTRACT.YESTONLY,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(120,120),RLSE),UNIT=SYSDA
//*
//TODYONLY DD DSN=P2D.TEST.EXTRACT.TODYONLY,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(120,120),RLSE),UNIT=SYSDA
//*
//COMMON DD DSN=P2D.TEST.EXTRACT.COMMON,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(120,120),RLSE),UNIT=SYSDA
//*
//SYSIN DD *
OPTION COPY
JOINKEYS FILE=F1,FIELDS=(21,100,A)
JOINKEYS FILE=F2,FIELDS=(21,100,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,4,?,F2:1,2052,F1:5)
OUTFIL FNAMES=COMMON,INCLUDE=(5,1,CH,EQ,C'B'),BUILD=(1,4,2058)
OUTFIL FNAMES=YESTONLY,INCLUDE=(5,1,CH,EQ,C'1'),BUILD=(1,4,2058)
OUTFIL FNAMES=TODYONLY,INCLUDE=(5,1,CH,EQ,C'2'),BUILD=(1,4,10,2048),
VLTRIM=C' '
//* |
|
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi Skolusu,
The job is working now and I need to check the output in detail:
But I got some doubts :
1) Kindly explain the Reformat. Also for VB file how the reformat is different.
2) Why VLTRIM=C' ' is used ?
3) How the output file becomes VB ? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
This is why I suggested the "learning exercise". If you complete that, you should be able to answer all those questions yourself, and perhaps pick up something else along the way.
Do you have time to go through that, or are just desperate for an answer?
Also, in future, don't post questions with the Subject all in upper-case. |
|
| Back to top |
|
 |
abhijit.nayak01
Active User
Joined: 22 Mar 2009 Posts: 161 Location: South Africa
|
|
|
|
Hi Bill,
Actually I went through the materials and digging more. And the REFORMAT for FB I understood. Need to check more examples for VB.
I was not aware of the subject line upper case. Apology for that and I will take care from my next post. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| abhijit.nayak01 wrote: |
Actually I went through the materials and digging more. And the REFORMAT for FB I understood. Need to check more examples for VB. |
| abhijit.nayak01 wrote: |
Hi Skolusu,
The job is working now and I need to check the output in detail:
But I got some doubts :
1) Kindly explain the Reformat. Also for VB file how the reformat is different.
2) Why VLTRIM=C' ' is used ?
3) How the output file becomes VB ? |
abhijit.nayak01,
If you really went thru the documentation I provided earlier here in this topic reading through "z/OS DFSORT: Getting Started" you wouldn't be asking me what VLTRIM does.
Did you even bother reading the REFORMAT statement? If you did you will find out how a variable record is created. Here it is once again the Joinkeys documentation that explains about how p without m gives the starting position of a variable field under the explanation of REFORMAT statement.
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.0?
Given how many times I stressed about you understanding the control cards, this will be the last time I am going to spoon feed you. You just don't seem to put minimum effort to understand the job you are given. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|