View previous topic :: View next topic
|
Author |
Message |
Vidya Bhama
New User
Joined: 17 Sep 2008 Posts: 41 Location: Chennai
|
|
|
|
Hi,
I need to access a table field (empno) that occurs 10 times in my input data file using a JCL to be written onto a new file with each entry of the table as a record.
Is it possible to do the above without writing a COBOL program?
Could anyone Please help on the above case.
Thanks
Vidya |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Vidya and welcome to the forum,
Probably. . .
Please post some sample knput and the output you want when this input is processed.
Also, please mention the recfm and lrecl of the files.
Which sort product is used on your system? |
|
Back to top |
|
|
Vidya Bhama
New User
Joined: 17 Sep 2008 Posts: 41 Location: Chennai
|
|
|
|
Hi Dick,
Thank you. Happy that I have come here.
Sample of my Input format is as below,
empname PIC x(10).
entries PIC 9(1).
empno PIC 9(3) occurs 10 times.
If the entries field equals to 3 then empno field would be like below,
empno(1)=101 empno(2)=102 empno(3)=103.
my output should look as below. each emp no should be displayed as a separate record.
Alex 2 101
Alex 2 102
Alex 2 103
John 1 200
Mary 3 301
Mary 3 302
Mary 3 303
I use the SYNCSORT in our system. My RECFM is FB.
Please let me know if the above is clear |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
You can use the below SYNCTOOL job to achieve this.
Code: |
//STEP1 EXEC PGM=SYNCTOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD *
Alex 2 101102
John 1 200
Mary 3 301302303
//T1 DD DSN=&&T1,DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
//CTL1CNTL DD *
OUTFIL BUILD=(1,7,08,3,/,
1,7,11,3,/,
1,7,14,3,/,
1,7,17,3,/,
1,7,20,3,/,
1,7,23,3,/,
1,7,26,3,/,
1,7,29,3,/,
1,7,32,3,/,
1,7,35,3)
//CTL2CNTL DD *
OUTFIL OMIT=(8,3,CH,EQ,C' ') |
OUT
Code: |
Alex 2 101
Alex 2 102
John 1 200
Mary 3 301
Mary 3 302
Mary 3 303 |
|
|
Back to top |
|
|
anand tr
New User
Joined: 12 Aug 2008 Posts: 41 Location: chennai
|
|
|
|
hi,
can we use the same concept by givin the input in a DSN(i mean to say instead of an instream data),then in tat case, wat do we need to change in OUTFIL?
Also can we use SORT in the EXEC statement instead of SYNCTOOL? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
can we use the same concept by givin the input in a DSN(i mean to say instead of an instream data),then in tat case, wat do we need to change in OUTFIL? |
Yes. you can. You dont need to change anything if your input layout matches with the data given above.
Quote: |
Also can we use SORT in the EXEC statement instead of SYNCTOOL? |
No. SORT and SYNCTOOL are not the same. Each of them has its own control statements. |
|
Back to top |
|
|
anand tr
New User
Joined: 12 Aug 2008 Posts: 41 Location: chennai
|
|
|
|
thanks Arcvns,
well i wanted to know whether SYNCTOOL program is equivalent to ICETOOL program(DFSORT)? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Anand,
Syncsort's SYNCTOOL is equivalent to DFSORT's ICETOOL. See this previous topic for more details. |
|
Back to top |
|
|
anand tr
New User
Joined: 12 Aug 2008 Posts: 41 Location: chennai
|
|
|
|
Thanks,
That link cleared some of my doubts.., |
|
Back to top |
|
|
Vidya Bhama
New User
Joined: 17 Sep 2008 Posts: 41 Location: Chennai
|
|
|
|
thanks for the code...it worked.
Can I use OUTREC option with OUTFIL BUILD.
For eg I have the below input
Alex 2 101 englishdept boston 102
the desired output is
Alex 2 englishdept 101 boston
Alex 2 englishdept 102 boston |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Vidya Bhama wrote: |
For eg I have the below input
Alex 2 101 englishdept boston 102
the desired output is
Alex 2 englishdept 101 boston
Alex 2 englishdept 102 boston |
The sample data provided does n't seem to clarify what you exactly want to achieve. Do you have any other fields in the ws-table other than "empno"?
Are "englishdept" and "boston" ws-table field values? Can you post here the input/output cobol layout |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Syncsort's SYNCTOOL is equivalent to DFSORT's ICETOOL. |
No, it isn't. DFSORT's ICETOOL is fully documented. Syncsort's SYNCTOOL is not documented.
DFSORT's ICETOOL has functions that Syncsort's SYNCTOOL does not have such as the DATASORT and SUBSET operators, and many operands such as FIRST(n) and FIRSTDUP(n) for the SELECT operator, WITHANY for the SPLICE operator, ADD, SUB, WRITE, TEXT, DIGITS, EDCOUNT and WIDTH for the COUNT operator, COUNT, EDCOUNT, BCOUNT, EDBCOUNT for the DISPLAY operator, NOCC, multiple TITLE operands, TLEFT, TFIRST for the DISPLAY and OCCUR operators, etc. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Frank,
By equivalent I meant "to be similar" and not exactly the same. I am aware that you've added a lot more functions in DFSORT.
I m sorry If I confused anybody by qouting that. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Equivalent does not mean "similar". It means "equal". You might want to be more careful with your terminology so as not to imply what you don't mean to imply. |
|
Back to top |
|
|
Vidya Bhama
New User
Joined: 17 Sep 2008 Posts: 41 Location: Chennai
|
|
|
|
Hi,
I meant to say that my emp_no is the only table field in the Input file and also the values for the field does not come in a continous order in the file. Say for example the empno(1) comes in col 6-8 ,empno(2) comes in col
29-31.
eg: emp_no PIC 9(3) occurs 10 times.
Inut file looks as below (highlighted in bold are the empno values found in the file positions 6-8 and 29-31)
input: Alex2101englishdeptboston102
output: Alex 2 englishdept 101 boston
Alex 2 englishdept 102 boston
and my output should look as stated before with fillers in between each field and the emp number taken up in each line.Can this be done in Outfil itself or Outrec combined with Outfil? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
eg: emp_no PIC 9(3) occurs 10 times.
Inut file looks as below (highlighted in bold are the empno values found in the file positions 6-8 and 29-31)
input: Alex2101englishdeptboston102
output:
Alex 2 englishdept 101 boston
Alex 2 englishdept 102 boston |
Your "code" an your data do not match. Where is the 3rd "occurs" value? How should the code know to put the 101 or 102 in the middle of the text? Why is the "2" separated from "Alex" in the output.
For someone to help, you need to actually post the proper definition.
No one should try to suggest anything until you completely define the rules. |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
Frank Yaeger wrote: |
Quote: |
Syncsort's SYNCTOOL is equivalent to DFSORT's ICETOOL. |
No, it isn't. DFSORT's ICETOOL is fully documented. Syncsort's SYNCTOOL is not documented.
DFSORT's ICETOOL has functions that Syncsort's SYNCTOOL does not have such as the DATASORT and SUBSET operators, and many operands such as FIRST(n) and FIRSTDUP(n) for the SELECT operator, WITHANY for the SPLICE operator, ADD, SUB, WRITE, TEXT, DIGITS, EDCOUNT and WIDTH for the COUNT operator, COUNT, EDCOUNT, BCOUNT, EDBCOUNT for the DISPLAY operator, NOCC, multiple TITLE operands, TLEFT, TFIRST for the DISPLAY and OCCUR operators, etc. |
I really want to believe that Alissa (wich btw is the JCL moderator) takes note of these posts in order to improve SYNCTOOL.
I cannot remember but I THINK she told me once they were working on SyncTool Documentation.
. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I really want to believe that Alissa (wich btw is the JCL moderator) takes note of these posts in order to improve SYNCTOOL.
I cannot remember but I THINK she told me once they were working on SyncTool Documentation. |
I distinctly remember that she originally posted that they were, but then later posted that they weren't. I wish I had kept track of the specific URLs with those posts, but I didn't. It may have actually been on another help board. |
|
Back to top |
|
|
|