IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Display the values of two input file in reverse order


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Jul 15, 2005 4:04 pm
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
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
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
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top