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
 

 

Display the values of two input file in reverse order

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jivisampath

New User


Joined: 27 Jun 2005
Posts: 2
Location: bangalore

PostPosted: Fri Jul 15, 2005 12:29 pm    Post subject: Display the values of two input file in reverse order
Reply with quote

I have two values in input-file.I want to display those values in reverse order......
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Jul 15, 2005 4:04 pm    Post subject: Re: cobol
Reply with quote

Hi jivisampath,

Quote:
two values in input-file


Means what...Do you have only two records in I/P file....

Quote:
want to display those values in reverse order......


Do you want to reverse the record by count.....

Please give some I/P & O/P example.....

Regards,

Priyesh.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Sat Jul 23, 2005 6:31 pm    Post subject:
Reply with quote

a file can b acessed in rev order if we open with reverse option.then the records can b displayed.
Back to top
View user's profile Send private message
cheli

New User


Joined: 21 Jul 2005
Posts: 11

PostPosted: Mon Jul 25, 2005 12:45 pm    Post subject:
Reply with quote

Hi,
we can only open the tape files in reverese order.I think to reverese the sequential files we need to use sort steps in your job before actual processing.

If I am wrong please correct me.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Mon Jul 25, 2005 1:29 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

hi cheli
thank u 4 ur correction.can u give me the syntax please.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Mon Jul 25, 2005 1:30 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

hi cheli
thank u 4 ur correction.can u give me the syntax please.
Back to top
View user's profile Send private message
shobam

New User


Joined: 18 Jul 2005
Posts: 34
Location: CN

PostPosted: Mon Jul 25, 2005 3:44 pm    Post subject:
Reply with quote

INREC FIELDS=(1,80,SEQNUM,8,ZD) // assigns the SEQNUM to 81st col
SORT FIELDS=(81,8,ZD,D) // sort the seqnum in DESC order
OUTREC FIELDS=(1,80) // write the output excluding the SEQNUM.

To retain the original order use the same SORTIN JOB.

Please correct me If I am wrong.
Back to top
View user's profile Send private message
cheli

New User


Joined: 21 Jul 2005
Posts: 11

PostPosted: Mon Jul 25, 2005 6:58 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

That's correct shobam.Narasimha you can use the controlcard posted by shobam.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Tue Jul 26, 2005 7:03 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

hi shobam
can u explain ZD and can u plstellme the use of inrec and outrec fields asi have no clear idea onthem.

thanks in advance
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Tue Jul 26, 2005 8:37 pm    Post subject:
Reply with quote

hi narasimha_devi

zd means zoned decimal it is just like display formate in cobol.inrec and ourec are used for you want to operations on fields,if you wnt some field and dont want some fields all these operations performed using with inrec and outrec fields.




thanooz
Back to top
View user's profile Send private message
shobam

New User


Joined: 18 Jul 2005
Posts: 34
Location: CN

PostPosted: Wed Jul 27, 2005 10:16 am    Post subject:
Reply with quote

Before SORTING a record you can make some formatting in the INPUT records using INREC.
Where the OUTREC will do the formmatting after the records get sorted.
Thats the basic difference between INREC and OUTREC.

So for the SORT card I gave,

1. The SEQNUM will be inserted at the position of 81 in the INPUT records.
2. Then the records will get sorted for the SEQNUM (8 characters from 81st position)
3. OUTREC results in the formatting of output records , so the output will be the first 80 characters from the INPUT record thus eliminating the SEQNUM.

As thanooz told ZD represents ZONED DECIMAL which is nothing but a datatype as CH which represents CHARACTER.

Please correct me if I am wrong.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Sat Jul 30, 2005 7:04 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

thank u thanooz and shobam.i go through the code if i hav clarifications i will bring to forum notice.tahnk u very much 4 ur patiec\nce n clear replies.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Sat Jul 30, 2005 7:04 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

thank u thanooz and shobam.i go through the code if i hav clarifications i will bring to forum notice.tahnk u very much 4 ur patiec\nce n clear replies.
Back to top
View user's profile Send private message
narasimha_devi
Warnings : 1

New User


Joined: 10 Mar 2005
Posts: 26

PostPosted: Sat Jul 30, 2005 7:05 pm    Post subject: Re: Display the values of two input file in reverse order
Reply with quote

thank u thanooz and shobam.i go through the code if i hav clarifications i will bring to forum notice.tahnk u very much 4 ur clear replies.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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