View previous topic :: View next topic
|
Author |
Message |
jivisampath
New User
Joined: 27 Jun 2005 Posts: 2 Location: bangalore
|
|
|
|
I have two values in input-file.I want to display those values in reverse order...... |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
a file can b acessed in rev order if we open with reverse option.then the records can b displayed. |
|
Back to top |
|
|
cheli
New User
Joined: 21 Jul 2005 Posts: 11
|
|
|
|
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 |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
hi cheli
thank u 4 ur correction.can u give me the syntax please. |
|
Back to top |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
hi cheli
thank u 4 ur correction.can u give me the syntax please. |
|
Back to top |
|
|
shobam
New User
Joined: 18 Jul 2005 Posts: 34 Location: CN
|
|
|
|
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 |
|
|
cheli
New User
Joined: 21 Jul 2005 Posts: 11
|
|
|
|
That's correct shobam.Narasimha you can use the controlcard posted by shobam. |
|
Back to top |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
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 |
|
|
thanooz
New User
Joined: 28 Jun 2005 Posts: 99
|
|
|
|
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 |
|
|
shobam
New User
Joined: 18 Jul 2005 Posts: 34 Location: CN
|
|
|
|
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 |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
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 |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
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 |
|
|
narasimha_devi Warnings : 1 New User
Joined: 10 Mar 2005 Posts: 26
|
|
|
|
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 |
|
|
|