PUT DATA format question 
Author Message
 PUT DATA format question

I have a structure of which I want to print out each element, along with its
name. The standard way would be the PUT DATA, but this produces a list of
the elements nicely formatted agross the page. Like this:
<<<
FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=    11
FXPARM.B2.RZINSJ=   3.500

Does anyone know a way of getting the elements printed one each on a line ?
Like this:

<<<<
FXPARM.B2.BBVBNR='2'
FXPARM.B2.GUELVONT='0001-01-01'
FXPARM.B2.GUELBIST='9999-12-31'
FXPARM.B2.ZINSTAG=    11

...other than using EDIT and typing the name in by hand? Idealy I'd like to
possibly combine the DATA and EDIT to format the output a bit like this:
<<<<
FXPARM.B2.BBVBNR         =   '2'
FXPARM.B2.GUELVONT    =   '0001-01-01'
FXPARM.B2.GUELBIST       =   '9999-12-31'
FXPARM.B2.ZINSTAG         =    11

Any ideas, tricks welcome.

tia,

Tim.



Sun, 05 Jun 2005 18:29:29 GMT  
 PUT DATA format question


Quote:
> I have a structure of which I want to print out each element, along with
its
> name. The standard way would be the PUT DATA, but this produces a list of
> the elements nicely formatted agross the page. Like this:
> <<<
> FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
> FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=    11
> FXPARM.B2.RZINSJ=   3.500

> Does anyone know a way of getting the elements printed one each on a line

?

 > Any ideas, tricks welcome.

Best idea would be to convert the PL/I to fortran,  see below:

program test
implicit none
type t2
  character :: bbvbnr
  character(10) :: guelvont
  character(10) :: guelbist
  integer :: zinstag
  real :: rzinsj
end type
type t1
   type (t2) :: b2
end type
type (t1) :: fxparm
namelist /param/ fxparm

fxparm%b2%bbvbnr = '2'
fxparm%b2%guelvont = '0001-01-01'
fxparm%b2%guelbist = '9999-12-31'
fxparm%b2%zinstag = 11
fxparm%b2%rzinsj = 3.500

write (*,nml=param)
end program

Outputs below:

 &PARAM
 FXPARM%B2%BBVBNR  = 2,
 FXPARM%B2%GUELVONT        = 0001-01-01,
 FXPARM%B2%GUELBIST        = 9999-12-31,
 FXPARM%B2%ZINSTAG =          11,
 FXPARM%B2%RZINSJ  =   3.500000
 /



Sun, 05 Jun 2005 22:47:26 GMT  
 PUT DATA format question

Quote:

> name. The standard way would be the PUT DATA, but this produces a list of
> the elements nicely formatted agross the page. Like this:
> <<<
> FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
> FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=    11
> FXPARM.B2.RZINSJ=   3.500

> Does anyone know a way of getting the elements printed one each on a line ?
> Like this:

> <<<<
> FXPARM.B2.BBVBNR='2'
> FXPARM.B2.GUELVONT='0001-01-01'
> FXPARM.B2.GUELBIST='9999-12-31'
> FXPARM.B2.ZINSTAG=    11

PUT SKIP DATA (FXPARM.B2.BBVBNR);
PUT SKIP DATA (FXPARM.B2.GUELVONT);
PUT SKIP DATA (FXPARM.B2.GUELBIST);
etc

- Show quoted text -

Quote:
> ...other than using EDIT and typing the name in by hand? Idealy I'd like to
> possibly combine the DATA and EDIT to format the output a bit like this:
> <<<<
> FXPARM.B2.BBVBNR         =   '2'
> FXPARM.B2.GUELVONT    =   '0001-01-01'
> FXPARM.B2.GUELBIST       =   '9999-12-31'
> FXPARM.B2.ZINSTAG         =    11

> Any ideas, tricks welcome.

> tia,

> Tim.



Sun, 05 Jun 2005 23:07:04 GMT  
 PUT DATA format question

Quote:



> > I have a structure of which I want to print out each element, along with
> its
> > name. The standard way would be the PUT DATA, but this produces a list of
> > the elements nicely formatted agross the page. Like this:
> > <<<
> > FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
> > FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=    11
> > FXPARM.B2.RZINSJ=   3.500

> > Does anyone know a way of getting the elements printed one each on a line
> ?

>  > Any ideas, tricks welcome.

> Best idea would be to convert the PL/I to Fortran,  see below:

Rot!  Namelist is a pain in the neck.

Why all that jibberish, when a simple

   PUT SKIP DATA (...) will do.



Sun, 05 Jun 2005 23:13:57 GMT  
 PUT DATA format question
I wish I hadn't asked now.
Thanks anyway David, but I don't have a fortran compiler...and don't want
one at the moment.
Tim.


Sun, 05 Jun 2005 23:32:00 GMT  
 PUT DATA format question
 I have a structure of which I want to print out each element, along with
its

Quote:
> > name. The standard way would be the PUT DATA, but this produces a list
of
> > the elements nicely formatted agross the page. Like this:
> > <<<
> > FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
> > FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=    11
> > FXPARM.B2.RZINSJ=   3.500

> > Does anyone know a way of getting the elements printed one each on a
line ?
> > Like this:

> > <<<<
> > FXPARM.B2.BBVBNR='2'
> > FXPARM.B2.GUELVONT='0001-01-01'
> > FXPARM.B2.GUELBIST='9999-12-31'
> > FXPARM.B2.ZINSTAG=    11

> PUT SKIP DATA (FXPARM.B2.BBVBNR);
> PUT SKIP DATA (FXPARM.B2.GUELVONT);
> PUT SKIP DATA (FXPARM.B2.GUELBIST);
> etc

That's what I really wanted to try and avoid., The structure(s) (I have a
couple) are all around 40/50 elements, and individually typing out the names
is a bit of a bind. Is there anyway, even with the use of pre-compiler
macros (which I've never used)  to perhaps create list of the names of the
elements automatically, maybe like this:?

do i = 1 to number_of elements_ in_struct_fxparm;
    name = name_of_element_in_fxparm(i);
    put skip data(name);
end;

 That would be my dream, of course.
Tim.



Sun, 05 Jun 2005 23:40:07 GMT  
 PUT DATA format question


Quote:

> Rot!  Namelist is a pain in the neck.

> Why all that jibberish, when a simple

>    PUT SKIP DATA (...) will do.

What jibberish?
the list is declared with 1 namelist statement and output on separate lines
as Tim requested with 1 write statement.
You admitted to Tim that you cant do what he wants with 1 output statement,
but indeed must use "jibberish" to get it done..

BTW, EVERYONE PLEASE NOTE...
Robin refuses to reply to my asking for a response to my challenge for a
translation of the string flip function posted a week ago (see below), and I
assume he wont ever admit PL/I cant translate it..

<<<<<<<<<<<<<<<<<<<
module test_1
contains
function flip(a)  result(b)
character(*) :: a(:)
character(len(a)) :: b(size(a))
b = a(size(a):1:-1)
end function flip
end module test_1

program test
use test_1
character(5) :: y(3), x(3) = ['line1','line2','line3']
y = flip(x)
write (*,'(a)') y  ! output as 3 individual records
end program



Mon, 06 Jun 2005 00:33:29 GMT  
 PUT DATA format question

Quote:
>I have a structure of which I want to print out each element, along
with its
>name. The standard way would be the PUT DATA, but this produces a list
of
>the elements nicely formatted agross the page. Like this:
><<<
>FXPARM.B2.BBVBNR='2'    FXPARM.B2.GUELVONT='0001-01-01'
>FXPARM.B2.GUELBIST='9999-12-31'                 FXPARM.B2.ZINSTAG=
11
>FXPARM.B2.RZINSJ=   3.500

>Does anyone know a way of getting the elements printed one each on a
line ?
>Like this:

><<<<
>FXPARM.B2.BBVBNR='2'
>FXPARM.B2.GUELVONT='0001-01-01'
>FXPARM.B2.GUELBIST='9999-12-31'
>FXPARM.B2.ZINSTAG=    11

>...other than using EDIT and typing the name in by hand? Idealy I'd
like to
>possibly combine the DATA and EDIT to format the output a bit like
this:
><<<<
>FXPARM.B2.BBVBNR         =   '2'
>FXPARM.B2.GUELVONT    =   '0001-01-01'
>FXPARM.B2.GUELBIST       =   '9999-12-31'
>FXPARM.B2.ZINSTAG         =    11

>Any ideas, tricks welcome.

Use PLITABS and set the number of tabs to zero.

Robert
--
Robert AH Prins



Mon, 06 Jun 2005 00:50:13 GMT  
 PUT DATA format question

...

Quote:
>>Does anyone know a way of getting the elements printed one each on a

> line ?

>>Like this:

>><<<<
>>FXPARM.B2.BBVBNR='2'
>>FXPARM.B2.GUELVONT='0001-01-01'

...

Quote:

> Use PLITABS and set the number of tabs to zero.

Congratulations to Robert for answering Tim's question instead of starting a
flame war on the relative merits of PL/I vs FORTRAN.

To add to Robert's answer, information on the format of the PLITABS structure
can be found in the Programming Guide that comes with the complier.



Mon, 06 Jun 2005 03:46:06 GMT  
 
 [ 20 post ]  Go to page: [1] [2]

 Relevant Pages 

1. data stored in an odd format - question

2. data validation and data format

3. data validation and data format

4. Put Data in a 2D Array after Button pressed

5. How to put data (from texte file) in the Tab

6. Including text into PUT DATA

7. Where to put OS Kernel Code and data?

8. puts big amount of data to a Socket

9. SmallEiffel and EiffelBase (COLLECTION.put vs. ARRAY.put)

10. ftp_lib.tcl 2.3 bgerror after timeout of control connection on put and false-positive FTP puts

11. puts -timeout or puts should return n_written

12. Initialising data in DATA statements question

 

 
Powered by phpBB® Forum Software