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
 

 

interview questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
purushoth_jp

New User


Joined: 12 Dec 2004
Posts: 22

PostPosted: Mon Feb 14, 2005 6:39 am    Post subject: interview questions
Reply with quote

hi all,
1. Iam having 2 files. first file contains 100,000 records, second file contains some 100 records. there are 10 records which are in both the files. can anyone plz suggest a method to separate the common records (i.e 10 records) in both the files and to place it in new file. using JCL or some other functions.

2. there is a table which is defined as
01 table1.
05 a pic X(1) occurs 5 times.
now in the procedure division im accepting values for the elements in the table. the content of the table is
a(1) = e, a(2) = d, a(3) = c, a(4) = b, a(5) = a.
is there is any function to sort the table in ascending order. so that the result will be
a(1) = a, a(2) = b, a(3) = c, a(4) = d, a(5) = e
or to reverse the table.

3.Is there is any function to find a length of a variable.
Back to top
View user's profile Send private message

rick

New User


Joined: 18 Jun 2004
Posts: 59
Location: Chennai

PostPosted: Thu Feb 17, 2005 2:51 pm    Post subject:
Reply with quote

Hi,

1. I dont think there is any function to do this.
2. It can be sorted using SORT command in cobol. If u want the reverse you can give decending order in the SORT command.
3. Yea we can find the length of the variable using the following
COMPUTE VAR1 = LENGTH OF VAR2.

Regards,
Rick.
frederick.tybalt@anewcon.com
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Fri Feb 18, 2005 7:07 am    Post subject:
Reply with quote

purushoth,

1) you can write a small easytrieve program to get this thing done. Currently I am totally swamped with the work so will not be able to post the code..
If you can wait till weekend, I can give you the solution

Regards
Mayuresh
Back to top
View user's profile Send private message
shantibhusan

New User


Joined: 19 Apr 2005
Posts: 2

PostPosted: Tue Apr 19, 2005 8:34 pm    Post subject: Re: interview questions
Reply with quote

1.Use the below jcl for getting the common records on FILE3.


000001 //JOBNAME JOB (,,,,#####),
000003 // CLASS=V,
000004 // NOTIFY=&SYSUID,
000005 // MSGCLASS=Q
000006 //* TO SORT AND SHIFT FIELDS
000007 //SORTIT EXEC PGM=SYNCSORT,PARM='ABEND'
000008 //SYSOUT DD SYSOUT=*
000009 //SORTIN DD DSN=FILE1
000010 // DD DSN=FILE2
000011 //SORTOUT DD SYSOUT=*
000012 //SORTXSUM DD DSN=FILE3
000013 //SYSIN DD *
000014 SORT FIELDS=(1,RECORD LENGTH OF FILE,CH,A)
000015 SUM FIELDS=NONE,XSUM
000016 /*
Back to top
View user's profile Send private message
shantibhusan

New User


Joined: 19 Apr 2005
Posts: 2

PostPosted: Tue Apr 19, 2005 8:39 pm    Post subject: Re: interview questions
Reply with quote

2.It is not possible to sort a table using SORT function in COBOL. SORT function is only used for files.To sort table use ur own logic in the procedure division like bubble sort.

Any body knows any other function to sort a table ?????
Back to top
View user's profile Send private message
ashutosh719

New User


Joined: 06 Apr 2005
Posts: 12

PostPosted: Sat May 07, 2005 2:12 pm    Post subject:
Reply with quote

for #3 uses STRLEN function in COBOL.
for #1 use SPLICE.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun May 15, 2005 5:44 am    Post subject:
Reply with quote

A little late to the party. icon_biggrin.gif

But, if the table is designated as being in descending order, you can use the reverse intrinsic function to put it in ascending order. You might try this:

MOVE FUNCTION REVERSE(TABLE1) TO TABLE1.

If the compiler doesn't let you do it, move it to a temp fld reversed, then move it back to TABLE1.
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Wed May 18, 2005 11:44 am    Post subject:
Reply with quote

Ashutosh,

Can u please give short examples for SPLICE and STRLEN?

Ajay
Back to top
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Mon Aug 08, 2005 2:39 pm    Post subject: Re: interview questions
Reply with quote

3. you can use Function LENGTH(string-name) or special register LENGTH OF to determine the length of a particular string/variable (either numeric data or alphanumeric)

You can use the LENGTH Function only where arithmetic expressions are allowed. However, you can use the LENGTH OF special register in many other contexts, for example, as a parameter in CALL, as an argument to an intrinsic function that allows integer arguments.

Thanks,
Kumar
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Sat Aug 13, 2005 12:51 am    Post subject:
Reply with quote

1) Try to search in DfSort entry and you will find the solution!
Your question is well satisfied in many sample.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm
No new posts Where can i find Interview questions ... Elixir Mainframe Interview Questions 4 Sat Feb 20, 2016 12:38 am


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