Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT Table field accessing in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Tue Sep 30, 2008 11:03 am    Post subject: SYNCSORT Table field accessing in JCL
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 30, 2008 11:09 am    Post subject:
Reply with quote

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
View user's profile Send private message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Tue Sep 30, 2008 11:36 am    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Tue Sep 30, 2008 12:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 01, 2008 11:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Wed Oct 01, 2008 11:56 am    Post subject:
Reply with quote

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
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 01, 2008 1:02 pm    Post subject:
Reply with quote

thanks Arcvns,
well i wanted to know whether SYNCTOOL program is equivalent to ICETOOL program(DFSORT)?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Wed Oct 01, 2008 1:24 pm    Post subject:
Reply with quote

Anand,

Syncsort's SYNCTOOL is equivalent to DFSORT's ICETOOL. See this previous topic for more details.
Back to top
View user's profile Send private message
anand tr

New User


Joined: 12 Aug 2008
Posts: 41
Location: chennai

PostPosted: Wed Oct 01, 2008 2:45 pm    Post subject:
Reply with quote

Thanks,
That link cleared some of my doubts..,
Back to top
View user's profile Send private message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Wed Oct 01, 2008 4:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Wed Oct 01, 2008 6:46 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Oct 01, 2008 11:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2284
Location: @my desk

PostPosted: Thu Oct 02, 2008 12:32 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Oct 02, 2008 1:44 am    Post subject:
Reply with quote

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
View user's profile Send private message
Vidya Bhama

New User


Joined: 17 Sep 2008
Posts: 41
Location: Chennai

PostPosted: Fri Oct 03, 2008 5:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Oct 04, 2008 12:25 am    Post subject:
Reply with quote

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
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Sun Oct 05, 2008 12:11 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Oct 05, 2008 11:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Accessing first bit of PD value rajatbagga DFSORT/ICETOOL 11 Wed May 03, 2017 6:03 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us