cobol语言如何将二维数组写入文件?
1个回答
展开全部
使用两层循环,详细处理不写了,大概逻辑是:
01 W-A.
03 W-A1 OCCURS 10 TIMES.
05 W-A2 OCCURS 5 TIMES.
PERFORM VARYING W-I FROM 1 BY 1 UNTIL W-I >10
PERFORM VARING W-J FROM 1 BY 1 UNTIL W-J >5
MOVE W-A2(W-I,W-J) TO FILE-ITEM
WRITE FILE
END-PERFORM
END-PERFORM
01 W-A.
03 W-A1 OCCURS 10 TIMES.
05 W-A2 OCCURS 5 TIMES.
PERFORM VARYING W-I FROM 1 BY 1 UNTIL W-I >10
PERFORM VARING W-J FROM 1 BY 1 UNTIL W-J >5
MOVE W-A2(W-I,W-J) TO FILE-ITEM
WRITE FILE
END-PERFORM
END-PERFORM
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询