Re: Productivity
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Dec 2006 10:10:38 +1300
"Rick Smith" <ricksmith@xxxxxxx> wrote in message
news:12pdftt926l3sb9@xxxxxxxxxxxxxxxxxxxxx
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4vm6ldF16ggd7U1@xxxxxxxxxxxxxxxxxxxxx
[snip]
01 IN-DATA.
12 FILLER PIC X(50) VALUE
"userId=FJS¦location=AURO¦function=filmRequest¦acct".
12 FILLER PIC X(50) VALUE
"Number=1234567890¦userExtension=1403¦routing=branc".
12 FILLER PIC X(50) VALUE
"h¦routeLoc=K-MISS¦routeAttn=Joe¦comments=Comments ".
12 FILLER PIC X(50) VALUE
"Go Here¦debit¦date=121306¦amount=100.00¦sequenceNb".
12 FILLER PIC X(50) VALUE
"r=12345678¦¦credit¦date=051406¦amount=900.00¦seque".
12 FILLER PIC X(50) VALUE
"nceNbr=11122233¦¦ATM¦date=010106¦amount=123.45¦¦ch".
12 FILLER PIC X(50) VALUE
"argeback¦date=010106¦amount=500.00¦¦statement¦date".
12 FILLER PIC X(50) VALUE
"=032906¦amount=1000.00¦ ".
01 INPUT-DATA REDEFINES IN-DATA PIC X(400).
Just an observation; but it seems easier to me,
when populating a large data item, to use the
STRING statement. For example, ...
move spaces to input-data
string
"userId=FJS¦location=AURO¦function=filmRequest¦acct"
"Number=1234567890¦userExtension=1403¦routing=branc"
"h¦routeLoc=K-MISS¦routeAttn=Joe¦comments=Comments "
"Go Here¦debit¦date=121306¦amount=100.00¦sequenceNb"
"r=12345678¦¦credit¦date=051406¦amount=900.00¦seque"
"nceNbr=11122233¦¦ATM¦date=010106¦amount=123.45¦¦ch"
"argeback¦date=010106¦amount=500.00¦¦statement¦date"
"=032906¦amount=1000.00¦"
delimited by size
into input-data.
And, multiple STRING statements allow
for multiple tests.
Furthermore, binary values may be inserted
by using hex literals (non-ANS 85). For example, ...
move spaces to cr-lf-separated-data
string
"abc" x"0d0a" "def" x"0d0a" "ghi" x"0d0a"
delimited by size
into cr-lf-separated-data.
All this with no messy counting!
Yes, that's a good point.
Over the years (starting from before STRING was available) I tried many ways
to insert long strings into COBOL programs. I'm sure most COBOL programmers
have encountered the same problem. Continuation is ugly and not simple; most
other definitions require counting as you point out, and that is also messy
and error prone.
I tried concatenation (similar to what you would do in VB) and that worked
OK but left me vaguely dissatisfied :-).
The above is as easy as I could make it on myself inasmuch as it is clear
and you don't need to count. (Just take X columns from wherever you start...
if it starts in 13 and you have defined X to be 50, it must end in 62, start
+ X - 1).
The Fujitsu IDE I use to write COBOL shows line and column for wherever you
put the cursor, so this is pretty simple. After doing the first one and
checking it, it is a simple matter to copy this and insert the rest.
Your point about hex literals is well taken, and for this it would certainly
be necessary to either concatenate or use STRING.
Pete.
.
- References:
- Productivity
- From: Pete Dashwood
- Re: Productivity
- From: HeyBub
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Robert Jones
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Frank Swarbrick
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Pete Dashwood
- Re: Productivity
- From: Rick Smith
- Productivity
- Prev by Date: Re: IBM and COBOL SEARCH ALL
- Next by Date: Re: Salary Question
- Previous by thread: Re: Productivity
- Next by thread: Re: Productivity
- Index(es):
Relevant Pages
|